diff --git a/client/pom.xml b/client/pom.xml index acae086f4..d593b54ef 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -22,7 +22,11 @@ a2a-java-sdk-common ${project.version} - + + ${project.groupId} + a2a-java-sdk-grpc + ${project.version} + ${project.groupId} a2a-java-sdk-spec diff --git a/client/src/main/java/io/a2a/client/A2AGrpcClient.java b/client/src/main/java/io/a2a/client/A2AGrpcClient.java new file mode 100644 index 000000000..661adc228 --- /dev/null +++ b/client/src/main/java/io/a2a/client/A2AGrpcClient.java @@ -0,0 +1,200 @@ +package io.a2a.client; + +import static io.a2a.grpc.A2AServiceGrpc.A2AServiceBlockingV2Stub; +import static io.a2a.grpc.A2AServiceGrpc.A2AServiceStub; +import static io.a2a.grpc.utils.ProtoUtils.FromProto; +import static io.a2a.grpc.utils.ProtoUtils.ToProto; +import static io.a2a.util.Assert.checkNotNullParam; + +import java.util.function.Consumer; + +import io.a2a.client.sse.SSEStreamObserver; +import io.a2a.grpc.A2AServiceGrpc; +import io.a2a.grpc.CancelTaskRequest; +import io.a2a.grpc.CreateTaskPushNotificationConfigRequest; +import io.a2a.grpc.GetTaskPushNotificationConfigRequest; +import io.a2a.grpc.GetTaskRequest; +import io.a2a.grpc.SendMessageRequest; +import io.a2a.grpc.SendMessageResponse; +import io.a2a.grpc.StreamResponse; +import io.a2a.grpc.utils.ProtoUtils; +import io.a2a.spec.A2AServerException; +import io.a2a.spec.AgentCard; +import io.a2a.spec.EventKind; +import io.a2a.spec.GetTaskPushNotificationConfigParams; +import io.a2a.spec.MessageSendParams; +import io.a2a.spec.StreamingEventKind; +import io.a2a.spec.Task; +import io.a2a.spec.TaskIdParams; +import io.a2a.spec.TaskPushNotificationConfig; +import io.a2a.spec.TaskQueryParams; +import io.grpc.Channel; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; + +/** + * A2A Client for interacting with an A2A agent via gRPC. + */ +public class A2AGrpcClient { + + private A2AServiceBlockingV2Stub blockingStub; + private A2AServiceStub asyncStub; + private AgentCard agentCard; + + /** + * Create an A2A client for interacting with an A2A agent via gRPC. + * + * @param channel the gRPC channel + * @param agentCard the agent card for the A2A server this client will be communicating with + */ + public A2AGrpcClient(Channel channel, AgentCard agentCard) { + checkNotNullParam("channel", channel); + checkNotNullParam("agentCard", agentCard); + this.asyncStub = A2AServiceGrpc.newStub(channel); + this.blockingStub = A2AServiceGrpc.newBlockingV2Stub(channel); + this.agentCard = agentCard; + } + + /** + * Send a message to the remote agent. + * + * @param messageSendParams the parameters for the message to be sent + * @return the response, may be a message or a task + * @throws A2AServerException if sending the message fails for any reason + */ + public EventKind sendMessage(MessageSendParams messageSendParams) throws A2AServerException { + SendMessageRequest request = createGrpcSendMessageRequestFromMessageSendParams(messageSendParams); + try { + SendMessageResponse response = blockingStub.sendMessage(request); + if (response.hasMsg()) { + return FromProto.message(response.getMsg()); + } else if (response.hasTask()) { + return FromProto.task(response.getTask()); + } else { + throw new A2AServerException("Server response did not contain a message or task"); + } + } catch (StatusRuntimeException e) { + throw new A2AServerException("Failed to send message: " + e, e); + } + } + + /** + * Retrieves the current state and history of a specific task. + * + * @param taskQueryParams the params for the task to be queried + * @return the task + * @throws A2AServerException if retrieving the task fails for any reason + */ + public Task getTask(TaskQueryParams taskQueryParams) throws A2AServerException { + GetTaskRequest.Builder requestBuilder = GetTaskRequest.newBuilder(); + requestBuilder.setName("tasks/" + taskQueryParams.id()); + if (taskQueryParams.historyLength() != null) { + requestBuilder.setHistoryLength(taskQueryParams.historyLength()); + } + GetTaskRequest getTaskRequest = requestBuilder.build(); + try { + return FromProto.task(blockingStub.getTask(getTaskRequest)); + } catch (StatusRuntimeException e) { + throw new A2AServerException("Failed to get task: " + e, e); + } + } + + /** + * Cancel a task that was previously submitted to the A2A server. + * + * @param taskIdParams the params for the task to be cancelled + * @return the updated task + * @throws A2AServerException if cancelling the task fails for any reason + */ + public Task cancelTask(TaskIdParams taskIdParams) throws A2AServerException { + CancelTaskRequest cancelTaskRequest = CancelTaskRequest.newBuilder() + .setName("tasks/" + taskIdParams.id()) + .build(); + try { + return FromProto.task(blockingStub.cancelTask(cancelTaskRequest)); + } catch (StatusRuntimeException e) { + throw new A2AServerException("Failed to cancel task: " + e, e); + } + } + + /** + * Set push notification configuration for a task. + * + * @param taskPushNotificationConfig the task push notification configuration + * @return the task push notification config + * @throws A2AServerException if setting the push notification configuration fails for any reason + */ + public TaskPushNotificationConfig setTaskPushNotificationConfig(TaskPushNotificationConfig taskPushNotificationConfig) throws A2AServerException { + String configId = taskPushNotificationConfig.pushNotificationConfig().id(); + CreateTaskPushNotificationConfigRequest request = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + taskPushNotificationConfig.taskId()) + .setConfig(ToProto.taskPushNotificationConfig(taskPushNotificationConfig)) + .setConfigId(configId == null ? "" : configId) + .build(); + try { + return FromProto.taskPushNotificationConfig(blockingStub.createTaskPushNotificationConfig(request)); + } catch (StatusRuntimeException e) { + throw new A2AServerException("Failed to set the task push notification config: " + e, e); + } + } + + /** + * Get the push notification configuration for a task. + * + * @param getTaskPushNotificationConfigParams the params for the task + * @return the push notification configuration + * @throws A2AServerException if getting the push notification configuration fails for any reason + */ + public TaskPushNotificationConfig getTaskPushNotificationConfig(GetTaskPushNotificationConfigParams getTaskPushNotificationConfigParams) throws A2AServerException { + GetTaskPushNotificationConfigRequest getTaskPushNotificationConfigRequest = GetTaskPushNotificationConfigRequest.newBuilder() + .setName(getTaskPushNotificationConfigName(getTaskPushNotificationConfigParams)) + .build(); + try { + return FromProto.taskPushNotificationConfig(blockingStub.getTaskPushNotificationConfig(getTaskPushNotificationConfigRequest)); + } catch (StatusRuntimeException e) { + throw new A2AServerException("Failed to get the task push notification config: " + e, e); + } + } + + /** + * Send a streaming message request to the remote agent. + * + * @param messageSendParams the parameters for the message to be sent + * @param eventHandler a consumer that will be invoked for each event received from the remote agent + * @param errorHandler a consumer that will be invoked if an error occurs + * @throws A2AServerException if sending the streaming message fails for any reason + */ + public void sendMessageStreaming(MessageSendParams messageSendParams, Consumer eventHandler, + Consumer errorHandler) throws A2AServerException { + SendMessageRequest request = createGrpcSendMessageRequestFromMessageSendParams(messageSendParams); + StreamObserver streamObserver = new SSEStreamObserver(eventHandler, errorHandler); + try { + asyncStub.sendStreamingMessage(request, streamObserver); + } catch (StatusRuntimeException e) { + throw new A2AServerException("Failed to send streaming message: " + e, e); + } + } + + private SendMessageRequest createGrpcSendMessageRequestFromMessageSendParams(MessageSendParams messageSendParams) { + SendMessageRequest.Builder builder = SendMessageRequest.newBuilder(); + builder.setRequest(ToProto.message(messageSendParams.message())); + if (messageSendParams.configuration() != null) { + builder.setConfiguration(ToProto.messageSendConfiguration(messageSendParams.configuration())); + } + if (messageSendParams.metadata() != null) { + builder.setMetadata(ToProto.struct(messageSendParams.metadata())); + } + return builder.build(); + } + + private String getTaskPushNotificationConfigName(GetTaskPushNotificationConfigParams getTaskPushNotificationConfigParams) { + StringBuilder name = new StringBuilder(); + name.append("tasks/"); + name.append(getTaskPushNotificationConfigParams.id()); + if (getTaskPushNotificationConfigParams.pushNotificationConfigId() != null) { + name.append("/pushNotificationConfigs/"); + name.append(getTaskPushNotificationConfigParams.pushNotificationConfigId()); + } + return name.toString(); + } +} diff --git a/client/src/main/java/io/a2a/client/sse/SSEStreamObserver.java b/client/src/main/java/io/a2a/client/sse/SSEStreamObserver.java new file mode 100644 index 000000000..adc721f42 --- /dev/null +++ b/client/src/main/java/io/a2a/client/sse/SSEStreamObserver.java @@ -0,0 +1,57 @@ +package io.a2a.client.sse; + + +import static io.a2a.grpc.utils.ProtoUtils.FromProto; + +import java.util.function.Consumer; +import java.util.logging.Logger; + +import io.a2a.grpc.StreamResponse; +import io.a2a.spec.StreamingEventKind; +import io.grpc.stub.StreamObserver; + +public class SSEStreamObserver implements StreamObserver { + + private static final Logger log = Logger.getLogger(SSEStreamObserver.class.getName()); + private final Consumer eventHandler; + private final Consumer errorHandler; + + public SSEStreamObserver(Consumer eventHandler, Consumer errorHandler) { + this.eventHandler = eventHandler; + this.errorHandler = errorHandler; + } + + @Override + public void onNext(StreamResponse response) { + StreamingEventKind event; + switch (response.getPayloadCase()) { + case MSG: + event = FromProto.message(response.getMsg()); + break; + case TASK: + event = FromProto.task(response.getTask()); + break; + case STATUS_UPDATE: + event = FromProto.taskStatusUpdateEvent(response.getStatusUpdate()); + break; + case ARTIFACT_UPDATE: + event = FromProto.taskArtifactUpdateEvent(response.getArtifactUpdate()); + break; + default: + log.warning("Invalid stream response " + response.getPayloadCase()); + errorHandler.accept(new IllegalStateException("Invalid stream response from server: " + response.getPayloadCase())); + return; + } + eventHandler.accept(event); + } + + @Override + public void onError(Throwable t) { + errorHandler.accept(t); + } + + @Override + public void onCompleted() { + // done + } +} diff --git a/grpc/pom.xml b/grpc/pom.xml new file mode 100644 index 000000000..a8e7d634e --- /dev/null +++ b/grpc/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + + io.github.a2asdk + a2a-java-sdk-parent + 0.2.6.Beta1-SNAPSHOT + + a2a-java-sdk-grpc + + jar + + Java SDK A2A gRPC + Java SDK for the Agent2Agent Protocol (A2A) - gRPC + + + + io.github.a2asdk + a2a-java-sdk-spec + ${project.version} + + + com.google.protobuf + protobuf-java + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + + + + diff --git a/grpc/src/main/java/io/a2a/grpc/A2A.java b/grpc/src/main/java/io/a2a/grpc/A2A.java new file mode 100644 index 000000000..1b38002d7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/A2A.java @@ -0,0 +1,836 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public final class A2A { + private A2A() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + A2A.class.getName()); + } + 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_a2a_v1_SendMessageConfiguration_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_SendMessageConfiguration_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_Task_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_Task_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_TaskStatus_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_TaskStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_Part_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_Part_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_FilePart_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_FilePart_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_DataPart_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_DataPart_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_Message_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_Message_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_Artifact_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_Artifact_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_TaskStatusUpdateEvent_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_TaskStatusUpdateEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_TaskArtifactUpdateEvent_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_TaskArtifactUpdateEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_PushNotificationConfig_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_PushNotificationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AuthenticationInfo_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AuthenticationInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentInterface_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentInterface_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentCard_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentCard_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentCard_SecuritySchemesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentCard_SecuritySchemesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentProvider_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentProvider_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentCapabilities_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentCapabilities_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentExtension_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentExtension_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AgentSkill_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AgentSkill_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_TaskPushNotificationConfig_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_TaskPushNotificationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_StringList_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_StringList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_Security_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_Security_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_Security_SchemesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_Security_SchemesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_SecurityScheme_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_SecurityScheme_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_APIKeySecurityScheme_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_APIKeySecurityScheme_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_HTTPAuthSecurityScheme_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_HTTPAuthSecurityScheme_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_OAuth2SecurityScheme_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_OAuth2SecurityScheme_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_OpenIdConnectSecurityScheme_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_OpenIdConnectSecurityScheme_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_OAuthFlows_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_OAuthFlows_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_ScopesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_ScopesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_ClientCredentialsOAuthFlow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_ClientCredentialsOAuthFlow_ScopesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_ClientCredentialsOAuthFlow_ScopesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_ImplicitOAuthFlow_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_ImplicitOAuthFlow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_ImplicitOAuthFlow_ScopesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_ImplicitOAuthFlow_ScopesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_PasswordOAuthFlow_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_PasswordOAuthFlow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_PasswordOAuthFlow_ScopesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_PasswordOAuthFlow_ScopesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_SendMessageRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_SendMessageRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_GetTaskRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_GetTaskRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_CancelTaskRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_CancelTaskRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_TaskSubscriptionRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_TaskSubscriptionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_GetAgentCardRequest_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_GetAgentCardRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_SendMessageResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_SendMessageResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_StreamResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_StreamResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_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\ta2a.proto\022\006a2a.v1\032\034google/api/annotati" + + "ons.proto\032\027google/api/client.proto\032\037goog" + + "le/api/field_behavior.proto\032\033google/prot" + + "obuf/empty.proto\032\034google/protobuf/struct" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\336\001\n\030SendMessageConfiguration\0222\n\025accepted" + + "_output_modes\030\001 \003(\tR\023acceptedOutputModes" + + "\022K\n\021push_notification\030\002 \001(\0132\036.a2a.v1.Pus" + + "hNotificationConfigR\020pushNotification\022%\n" + + "\016history_length\030\003 \001(\005R\rhistoryLength\022\032\n\010" + + "blocking\030\004 \001(\010R\010blocking\"\361\001\n\004Task\022\016\n\002id\030" + + "\001 \001(\tR\002id\022\035\n\ncontext_id\030\002 \001(\tR\tcontextId" + + "\022*\n\006status\030\003 \001(\0132\022.a2a.v1.TaskStatusR\006st" + + "atus\022.\n\tartifacts\030\004 \003(\0132\020.a2a.v1.Artifac" + + "tR\tartifacts\022)\n\007history\030\005 \003(\0132\017.a2a.v1.M" + + "essageR\007history\0223\n\010metadata\030\006 \001(\0132\027.goog" + + "le.protobuf.StructR\010metadata\"\231\001\n\nTaskSta" + + "tus\022\'\n\005state\030\001 \001(\0162\021.a2a.v1.TaskStateR\005s" + + "tate\022(\n\006update\030\002 \001(\0132\017.a2a.v1.MessageR\007m" + + "essage\0228\n\ttimestamp\030\003 \001(\0132\032.google.proto" + + "buf.TimestampR\ttimestamp\"t\n\004Part\022\024\n\004text" + + "\030\001 \001(\tH\000R\004text\022&\n\004file\030\002 \001(\0132\020.a2a.v1.Fi" + + "lePartH\000R\004file\022&\n\004data\030\003 \001(\0132\020.a2a.v1.Da" + + "taPartH\000R\004dataB\006\n\004part\"\177\n\010FilePart\022$\n\rfi" + + "le_with_uri\030\001 \001(\tH\000R\013fileWithUri\022(\n\017file" + + "_with_bytes\030\002 \001(\014H\000R\rfileWithBytes\022\033\n\tmi" + + "me_type\030\003 \001(\tR\010mimeTypeB\006\n\004file\"7\n\010DataP" + + "art\022+\n\004data\030\001 \001(\0132\027.google.protobuf.Stru" + + "ctR\004data\"\377\001\n\007Message\022\035\n\nmessage_id\030\001 \001(\t" + + "R\tmessageId\022\035\n\ncontext_id\030\002 \001(\tR\tcontext" + + "Id\022\027\n\007task_id\030\003 \001(\tR\006taskId\022 \n\004role\030\004 \001(" + + "\0162\014.a2a.v1.RoleR\004role\022&\n\007content\030\005 \003(\0132\014" + + ".a2a.v1.PartR\007content\0223\n\010metadata\030\006 \001(\0132" + + "\027.google.protobuf.StructR\010metadata\022\036\n\nex" + + "tensions\030\007 \003(\tR\nextensions\"\332\001\n\010Artifact\022" + + "\037\n\013artifact_id\030\001 \001(\tR\nartifactId\022\022\n\004name" + + "\030\003 \001(\tR\004name\022 \n\013description\030\004 \001(\tR\013descr" + + "iption\022\"\n\005parts\030\005 \003(\0132\014.a2a.v1.PartR\005par" + + "ts\0223\n\010metadata\030\006 \001(\0132\027.google.protobuf.S" + + "tructR\010metadata\022\036\n\nextensions\030\007 \003(\tR\next" + + "ensions\"\306\001\n\025TaskStatusUpdateEvent\022\027\n\007tas" + + "k_id\030\001 \001(\tR\006taskId\022\035\n\ncontext_id\030\002 \001(\tR\t" + + "contextId\022*\n\006status\030\003 \001(\0132\022.a2a.v1.TaskS" + + "tatusR\006status\022\024\n\005final\030\004 \001(\010R\005final\0223\n\010m" + + "etadata\030\005 \001(\0132\027.google.protobuf.StructR\010" + + "metadata\"\353\001\n\027TaskArtifactUpdateEvent\022\027\n\007" + + "task_id\030\001 \001(\tR\006taskId\022\035\n\ncontext_id\030\002 \001(" + + "\tR\tcontextId\022,\n\010artifact\030\003 \001(\0132\020.a2a.v1." + + "ArtifactR\010artifact\022\026\n\006append\030\004 \001(\010R\006appe" + + "nd\022\035\n\nlast_chunk\030\005 \001(\010R\tlastChunk\0223\n\010met" + + "adata\030\006 \001(\0132\027.google.protobuf.StructR\010me" + + "tadata\"\224\001\n\026PushNotificationConfig\022\016\n\002id\030" + + "\001 \001(\tR\002id\022\020\n\003url\030\002 \001(\tR\003url\022\024\n\005token\030\003 \001" + + "(\tR\005token\022B\n\016authentication\030\004 \001(\0132\032.a2a." + + "v1.AuthenticationInfoR\016authentication\"P\n" + + "\022AuthenticationInfo\022\030\n\007schemes\030\001 \003(\tR\007sc" + + "hemes\022 \n\013credentials\030\002 \001(\tR\013credentials\"" + + "@\n\016AgentInterface\022\020\n\003url\030\001 \001(\tR\003url\022\034\n\tt" + + "ransport\030\002 \001(\tR\ttransport\"\361\006\n\tAgentCard\022" + + ")\n\020protocol_version\030\020 \001(\tR\017protocolVersi" + + "on\022\022\n\004name\030\001 \001(\tR\004name\022 \n\013description\030\002 " + + "\001(\tR\013description\022\020\n\003url\030\003 \001(\tR\003url\022/\n\023pr" + + "eferred_transport\030\016 \001(\tR\022preferredTransp" + + "ort\022K\n\025additional_interfaces\030\017 \003(\0132\026.a2a" + + ".v1.AgentInterfaceR\024additionalInterfaces" + + "\0221\n\010provider\030\004 \001(\0132\025.a2a.v1.AgentProvide" + + "rR\010provider\022\030\n\007version\030\005 \001(\tR\007version\022+\n" + + "\021documentation_url\030\006 \001(\tR\020documentationU" + + "rl\022=\n\014capabilities\030\007 \001(\0132\031.a2a.v1.AgentC" + + "apabilitiesR\014capabilities\022Q\n\020security_sc" + + "hemes\030\010 \003(\0132&.a2a.v1.AgentCard.SecurityS" + + "chemesEntryR\017securitySchemes\022,\n\010security" + + "\030\t \003(\0132\020.a2a.v1.SecurityR\010security\022.\n\023de" + + "fault_input_modes\030\n \003(\tR\021defaultInputMod" + + "es\0220\n\024default_output_modes\030\013 \003(\tR\022defaul" + + "tOutputModes\022*\n\006skills\030\014 \003(\0132\022.a2a.v1.Ag" + + "entSkillR\006skills\022O\n$supports_authenticat" + + "ed_extended_card\030\r \001(\010R!supportsAuthenti" + + "catedExtendedCard\032Z\n\024SecuritySchemesEntr" + + "y\022\020\n\003key\030\001 \001(\tR\003key\022,\n\005value\030\002 \001(\0132\026.a2a" + + ".v1.SecuritySchemeR\005value:\0028\001\"E\n\rAgentPr" + + "ovider\022\020\n\003url\030\001 \001(\tR\003url\022\"\n\014organization" + + "\030\002 \001(\tR\014organization\"\230\001\n\021AgentCapabiliti" + + "es\022\034\n\tstreaming\030\001 \001(\010R\tstreaming\022-\n\022push" + + "_notifications\030\002 \001(\010R\021pushNotifications\022" + + "6\n\nextensions\030\003 \003(\0132\026.a2a.v1.AgentExtens" + + "ionR\nextensions\"\221\001\n\016AgentExtension\022\020\n\003ur" + + "i\030\001 \001(\tR\003uri\022 \n\013description\030\002 \001(\tR\013descr" + + "iption\022\032\n\010required\030\003 \001(\010R\010required\022/\n\006pa" + + "rams\030\004 \001(\0132\027.google.protobuf.StructR\006par" + + "ams\"\306\001\n\nAgentSkill\022\016\n\002id\030\001 \001(\tR\002id\022\022\n\004na" + + "me\030\002 \001(\tR\004name\022 \n\013description\030\003 \001(\tR\013des" + + "cription\022\022\n\004tags\030\004 \003(\tR\004tags\022\032\n\010examples" + + "\030\005 \003(\tR\010examples\022\037\n\013input_modes\030\006 \003(\tR\ni" + + "nputModes\022!\n\014output_modes\030\007 \003(\tR\013outputM" + + "odes\"\212\001\n\032TaskPushNotificationConfig\022\022\n\004n" + + "ame\030\001 \001(\tR\004name\022X\n\030push_notification_con" + + "fig\030\002 \001(\0132\036.a2a.v1.PushNotificationConfi" + + "gR\026pushNotificationConfig\" \n\nStringList\022" + + "\022\n\004list\030\001 \003(\tR\004list\"\223\001\n\010Security\0227\n\007sche" + + "mes\030\001 \003(\0132\035.a2a.v1.Security.SchemesEntry" + + "R\007schemes\032N\n\014SchemesEntry\022\020\n\003key\030\001 \001(\tR\003" + + "key\022(\n\005value\030\002 \001(\0132\022.a2a.v1.StringListR\005" + + "value:\0028\001\"\221\003\n\016SecurityScheme\022U\n\027api_key_" + + "security_scheme\030\001 \001(\0132\034.a2a.v1.APIKeySec" + + "uritySchemeH\000R\024apiKeySecurityScheme\022[\n\031h" + + "ttp_auth_security_scheme\030\002 \001(\0132\036.a2a.v1." + + "HTTPAuthSecuritySchemeH\000R\026httpAuthSecuri" + + "tyScheme\022T\n\026oauth2_security_scheme\030\003 \001(\013" + + "2\034.a2a.v1.OAuth2SecuritySchemeH\000R\024oauth2" + + "SecurityScheme\022k\n\037open_id_connect_securi" + + "ty_scheme\030\004 \001(\0132#.a2a.v1.OpenIdConnectSe" + + "curitySchemeH\000R\033openIdConnectSecuritySch" + + "emeB\010\n\006scheme\"h\n\024APIKeySecurityScheme\022 \n" + + "\013description\030\001 \001(\tR\013description\022\032\n\010locat" + + "ion\030\002 \001(\tR\010location\022\022\n\004name\030\003 \001(\tR\004name\"" + + "w\n\026HTTPAuthSecurityScheme\022 \n\013description" + + "\030\001 \001(\tR\013description\022\026\n\006scheme\030\002 \001(\tR\006sch" + + "eme\022#\n\rbearer_format\030\003 \001(\tR\014bearerFormat" + + "\"b\n\024OAuth2SecurityScheme\022 \n\013description\030" + + "\001 \001(\tR\013description\022(\n\005flows\030\002 \001(\0132\022.a2a." + + "v1.OAuthFlowsR\005flows\"n\n\033OpenIdConnectSec" + + "urityScheme\022 \n\013description\030\001 \001(\tR\013descri" + + "ption\022-\n\023open_id_connect_url\030\002 \001(\tR\020open" + + "IdConnectUrl\"\260\002\n\nOAuthFlows\022S\n\022authoriza" + + "tion_code\030\001 \001(\0132\".a2a.v1.AuthorizationCo" + + "deOAuthFlowH\000R\021authorizationCode\022S\n\022clie" + + "nt_credentials\030\002 \001(\0132\".a2a.v1.ClientCred" + + "entialsOAuthFlowH\000R\021clientCredentials\0227\n" + + "\010implicit\030\003 \001(\0132\031.a2a.v1.ImplicitOAuthFl" + + "owH\000R\010implicit\0227\n\010password\030\004 \001(\0132\031.a2a.v" + + "1.PasswordOAuthFlowH\000R\010passwordB\006\n\004flow\"" + + "\212\002\n\032AuthorizationCodeOAuthFlow\022+\n\021author" + + "ization_url\030\001 \001(\tR\020authorizationUrl\022\033\n\tt" + + "oken_url\030\002 \001(\tR\010tokenUrl\022\037\n\013refresh_url\030" + + "\003 \001(\tR\nrefreshUrl\022F\n\006scopes\030\004 \003(\0132..a2a." + + "v1.AuthorizationCodeOAuthFlow.ScopesEntr" + + "yR\006scopes\0329\n\013ScopesEntry\022\020\n\003key\030\001 \001(\tR\003k" + + "ey\022\024\n\005value\030\002 \001(\tR\005value:\0028\001\"\335\001\n\032ClientC" + + "redentialsOAuthFlow\022\033\n\ttoken_url\030\001 \001(\tR\010" + + "tokenUrl\022\037\n\013refresh_url\030\002 \001(\tR\nrefreshUr" + + "l\022F\n\006scopes\030\003 \003(\0132..a2a.v1.ClientCredent" + + "ialsOAuthFlow.ScopesEntryR\006scopes\0329\n\013Sco" + + "pesEntry\022\020\n\003key\030\001 \001(\tR\003key\022\024\n\005value\030\002 \001(" + + "\tR\005value:\0028\001\"\333\001\n\021ImplicitOAuthFlow\022+\n\021au" + + "thorization_url\030\001 \001(\tR\020authorizationUrl\022" + + "\037\n\013refresh_url\030\002 \001(\tR\nrefreshUrl\022=\n\006scop" + + "es\030\003 \003(\0132%.a2a.v1.ImplicitOAuthFlow.Scop" + + "esEntryR\006scopes\0329\n\013ScopesEntry\022\020\n\003key\030\001 " + + "\001(\tR\003key\022\024\n\005value\030\002 \001(\tR\005value:\0028\001\"\313\001\n\021P" + + "asswordOAuthFlow\022\033\n\ttoken_url\030\001 \001(\tR\010tok" + + "enUrl\022\037\n\013refresh_url\030\002 \001(\tR\nrefreshUrl\022=" + + "\n\006scopes\030\003 \003(\0132%.a2a.v1.PasswordOAuthFlo" + + "w.ScopesEntryR\006scopes\0329\n\013ScopesEntry\022\020\n\003" + + "key\030\001 \001(\tR\003key\022\024\n\005value\030\002 \001(\tR\005value:\0028\001" + + "\"\301\001\n\022SendMessageRequest\022.\n\007request\030\001 \001(\013" + + "2\017.a2a.v1.MessageB\003\340A\002R\007request\022F\n\rconfi" + + "guration\030\002 \001(\0132 .a2a.v1.SendMessageConfi" + + "gurationR\rconfiguration\0223\n\010metadata\030\003 \001(" + + "\0132\027.google.protobuf.StructR\010metadata\"P\n\016" + + "GetTaskRequest\022\027\n\004name\030\001 \001(\tB\003\340A\002R\004name\022" + + "%\n\016history_length\030\002 \001(\005R\rhistoryLength\"\'" + + "\n\021CancelTaskRequest\022\022\n\004name\030\001 \001(\tR\004name\"" + + ":\n$GetTaskPushNotificationConfigRequest\022" + + "\022\n\004name\030\001 \001(\tR\004name\"=\n\'DeleteTaskPushNot" + + "ificationConfigRequest\022\022\n\004name\030\001 \001(\tR\004na" + + "me\"\251\001\n\'CreateTaskPushNotificationConfigR" + + "equest\022\033\n\006parent\030\001 \001(\tB\003\340A\002R\006parent\022 \n\tc" + + "onfig_id\030\002 \001(\tB\003\340A\002R\010configId\022?\n\006config\030" + + "\003 \001(\0132\".a2a.v1.TaskPushNotificationConfi" + + "gB\003\340A\002R\006config\"-\n\027TaskSubscriptionReques" + + "t\022\022\n\004name\030\001 \001(\tR\004name\"{\n%ListTaskPushNot" + + "ificationConfigRequest\022\026\n\006parent\030\001 \001(\tR\006" + + "parent\022\033\n\tpage_size\030\002 \001(\005R\010pageSize\022\035\n\np" + + "age_token\030\003 \001(\tR\tpageToken\"\025\n\023GetAgentCa" + + "rdRequest\"m\n\023SendMessageResponse\022\"\n\004task" + + "\030\001 \001(\0132\014.a2a.v1.TaskH\000R\004task\022\'\n\003msg\030\002 \001(" + + "\0132\017.a2a.v1.MessageH\000R\007messageB\t\n\007payload" + + "\"\372\001\n\016StreamResponse\022\"\n\004task\030\001 \001(\0132\014.a2a." + + "v1.TaskH\000R\004task\022\'\n\003msg\030\002 \001(\0132\017.a2a.v1.Me" + + "ssageH\000R\007message\022D\n\rstatus_update\030\003 \001(\0132" + + "\035.a2a.v1.TaskStatusUpdateEventH\000R\014status" + + "Update\022J\n\017artifact_update\030\004 \001(\0132\037.a2a.v1" + + ".TaskArtifactUpdateEventH\000R\016artifactUpda" + + "teB\t\n\007payload\"\216\001\n&ListTaskPushNotificati" + + "onConfigResponse\022<\n\007configs\030\001 \003(\0132\".a2a." + + "v1.TaskPushNotificationConfigR\007configs\022&" + + "\n\017next_page_token\030\002 \001(\tR\rnextPageToken*\372" + + "\001\n\tTaskState\022\032\n\026TASK_STATE_UNSPECIFIED\020\000" + + "\022\030\n\024TASK_STATE_SUBMITTED\020\001\022\026\n\022TASK_STATE" + + "_WORKING\020\002\022\030\n\024TASK_STATE_COMPLETED\020\003\022\025\n\021" + + "TASK_STATE_FAILED\020\004\022\030\n\024TASK_STATE_CANCEL" + + "LED\020\005\022\035\n\031TASK_STATE_INPUT_REQUIRED\020\006\022\027\n\023" + + "TASK_STATE_REJECTED\020\007\022\034\n\030TASK_STATE_AUTH" + + "_REQUIRED\020\010*;\n\004Role\022\024\n\020ROLE_UNSPECIFIED\020" + + "\000\022\r\n\tROLE_USER\020\001\022\016\n\nROLE_AGENT\020\0022\272\n\n\nA2A" + + "Service\022c\n\013SendMessage\022\032.a2a.v1.SendMess" + + "ageRequest\032\033.a2a.v1.SendMessageResponse\"" + + "\033\202\323\344\223\002\025\"\020/v1/message:send:\001*\022k\n\024SendStre" + + "amingMessage\022\032.a2a.v1.SendMessageRequest" + + "\032\026.a2a.v1.StreamResponse\"\035\202\323\344\223\002\027\"\022/v1/me" + + "ssage:stream:\001*0\001\022R\n\007GetTask\022\026.a2a.v1.Ge" + + "tTaskRequest\032\014.a2a.v1.Task\"!\332A\004name\202\323\344\223\002" + + "\024\022\022/v1/{name=tasks/*}\022[\n\nCancelTask\022\031.a2" + + "a.v1.CancelTaskRequest\032\014.a2a.v1.Task\"$\202\323" + + "\344\223\002\036\"\031/v1/{name=tasks/*}:cancel:\001*\022s\n\020Ta" + + "skSubscription\022\037.a2a.v1.TaskSubscription" + + "Request\032\026.a2a.v1.StreamResponse\"$\202\323\344\223\002\036\022" + + "\034/v1/{name=tasks/*}:subscribe0\001\022\304\001\n Crea" + + "teTaskPushNotificationConfig\022/.a2a.v1.Cr" + + "eateTaskPushNotificationConfigRequest\032\"." + + "a2a.v1.TaskPushNotificationConfig\"K\332A\rpa" + + "rent,config\202\323\344\223\0025\"+/v1/{parent=task/*/pu" + + "shNotificationConfigs}:\006config\022\256\001\n\035GetTa" + + "skPushNotificationConfig\022,.a2a.v1.GetTas" + + "kPushNotificationConfigRequest\032\".a2a.v1." + + "TaskPushNotificationConfig\";\332A\004name\202\323\344\223\002" + + ".\022,/v1/{name=tasks/*/pushNotificationCon" + + "figs/*}\022\276\001\n\036ListTaskPushNotificationConf" + + "ig\022-.a2a.v1.ListTaskPushNotificationConf" + + "igRequest\032..a2a.v1.ListTaskPushNotificat" + + "ionConfigResponse\"=\332A\006parent\202\323\344\223\002.\022,/v1/" + + "{parent=tasks/*}/pushNotificationConfigs" + + "\022P\n\014GetAgentCard\022\033.a2a.v1.GetAgentCardRe" + + "quest\032\021.a2a.v1.AgentCard\"\020\202\323\344\223\002\n\022\010/v1/ca" + + "rd\022\250\001\n DeleteTaskPushNotificationConfig\022" + + "/.a2a.v1.DeleteTaskPushNotificationConfi" + + "gRequest\032\026.google.protobuf.Empty\";\332A\004nam" + + "e\202\323\344\223\002.*,/v1/{name=tasks/*/pushNotificat" + + "ionConfigs/*}B7\n\013io.a2a.grpcB\003A2AP\001Z\030goo" + + "gle.golang.org/a2a/v1\252\002\006A2a.V1b\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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_a2a_v1_SendMessageConfiguration_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_a2a_v1_SendMessageConfiguration_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_SendMessageConfiguration_descriptor, + new java.lang.String[] { "AcceptedOutputModes", "PushNotification", "HistoryLength", "Blocking", }); + internal_static_a2a_v1_Task_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_a2a_v1_Task_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_Task_descriptor, + new java.lang.String[] { "Id", "ContextId", "Status", "Artifacts", "History", "Metadata", }); + internal_static_a2a_v1_TaskStatus_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_a2a_v1_TaskStatus_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_TaskStatus_descriptor, + new java.lang.String[] { "State", "Update", "Timestamp", }); + internal_static_a2a_v1_Part_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_a2a_v1_Part_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_Part_descriptor, + new java.lang.String[] { "Text", "File", "Data", "Part", }); + internal_static_a2a_v1_FilePart_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_a2a_v1_FilePart_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_FilePart_descriptor, + new java.lang.String[] { "FileWithUri", "FileWithBytes", "MimeType", "File", }); + internal_static_a2a_v1_DataPart_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_a2a_v1_DataPart_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_DataPart_descriptor, + new java.lang.String[] { "Data", }); + internal_static_a2a_v1_Message_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_a2a_v1_Message_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_Message_descriptor, + new java.lang.String[] { "MessageId", "ContextId", "TaskId", "Role", "Content", "Metadata", "Extensions", }); + internal_static_a2a_v1_Artifact_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_a2a_v1_Artifact_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_Artifact_descriptor, + new java.lang.String[] { "ArtifactId", "Name", "Description", "Parts", "Metadata", "Extensions", }); + internal_static_a2a_v1_TaskStatusUpdateEvent_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_a2a_v1_TaskStatusUpdateEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_TaskStatusUpdateEvent_descriptor, + new java.lang.String[] { "TaskId", "ContextId", "Status", "Final", "Metadata", }); + internal_static_a2a_v1_TaskArtifactUpdateEvent_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_a2a_v1_TaskArtifactUpdateEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_TaskArtifactUpdateEvent_descriptor, + new java.lang.String[] { "TaskId", "ContextId", "Artifact", "Append", "LastChunk", "Metadata", }); + internal_static_a2a_v1_PushNotificationConfig_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_a2a_v1_PushNotificationConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_PushNotificationConfig_descriptor, + new java.lang.String[] { "Id", "Url", "Token", "Authentication", }); + internal_static_a2a_v1_AuthenticationInfo_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_a2a_v1_AuthenticationInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AuthenticationInfo_descriptor, + new java.lang.String[] { "Schemes", "Credentials", }); + internal_static_a2a_v1_AgentInterface_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_a2a_v1_AgentInterface_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentInterface_descriptor, + new java.lang.String[] { "Url", "Transport", }); + internal_static_a2a_v1_AgentCard_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_a2a_v1_AgentCard_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentCard_descriptor, + new java.lang.String[] { "ProtocolVersion", "Name", "Description", "Url", "PreferredTransport", "AdditionalInterfaces", "Provider", "Version", "DocumentationUrl", "Capabilities", "SecuritySchemes", "Security", "DefaultInputModes", "DefaultOutputModes", "Skills", "SupportsAuthenticatedExtendedCard", }); + internal_static_a2a_v1_AgentCard_SecuritySchemesEntry_descriptor = + internal_static_a2a_v1_AgentCard_descriptor.getNestedTypes().get(0); + internal_static_a2a_v1_AgentCard_SecuritySchemesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentCard_SecuritySchemesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_a2a_v1_AgentProvider_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_a2a_v1_AgentProvider_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentProvider_descriptor, + new java.lang.String[] { "Url", "Organization", }); + internal_static_a2a_v1_AgentCapabilities_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_a2a_v1_AgentCapabilities_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentCapabilities_descriptor, + new java.lang.String[] { "Streaming", "PushNotifications", "Extensions", }); + internal_static_a2a_v1_AgentExtension_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_a2a_v1_AgentExtension_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentExtension_descriptor, + new java.lang.String[] { "Uri", "Description", "Required", "Params", }); + internal_static_a2a_v1_AgentSkill_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_a2a_v1_AgentSkill_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AgentSkill_descriptor, + new java.lang.String[] { "Id", "Name", "Description", "Tags", "Examples", "InputModes", "OutputModes", }); + internal_static_a2a_v1_TaskPushNotificationConfig_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_a2a_v1_TaskPushNotificationConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_TaskPushNotificationConfig_descriptor, + new java.lang.String[] { "Name", "PushNotificationConfig", }); + internal_static_a2a_v1_StringList_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_a2a_v1_StringList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_StringList_descriptor, + new java.lang.String[] { "List", }); + internal_static_a2a_v1_Security_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_a2a_v1_Security_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_Security_descriptor, + new java.lang.String[] { "Schemes", }); + internal_static_a2a_v1_Security_SchemesEntry_descriptor = + internal_static_a2a_v1_Security_descriptor.getNestedTypes().get(0); + internal_static_a2a_v1_Security_SchemesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_Security_SchemesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_a2a_v1_SecurityScheme_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_a2a_v1_SecurityScheme_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_SecurityScheme_descriptor, + new java.lang.String[] { "ApiKeySecurityScheme", "HttpAuthSecurityScheme", "Oauth2SecurityScheme", "OpenIdConnectSecurityScheme", "Scheme", }); + internal_static_a2a_v1_APIKeySecurityScheme_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_a2a_v1_APIKeySecurityScheme_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_APIKeySecurityScheme_descriptor, + new java.lang.String[] { "Description", "Location", "Name", }); + internal_static_a2a_v1_HTTPAuthSecurityScheme_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_a2a_v1_HTTPAuthSecurityScheme_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_HTTPAuthSecurityScheme_descriptor, + new java.lang.String[] { "Description", "Scheme", "BearerFormat", }); + internal_static_a2a_v1_OAuth2SecurityScheme_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_a2a_v1_OAuth2SecurityScheme_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_OAuth2SecurityScheme_descriptor, + new java.lang.String[] { "Description", "Flows", }); + internal_static_a2a_v1_OpenIdConnectSecurityScheme_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_a2a_v1_OpenIdConnectSecurityScheme_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_OpenIdConnectSecurityScheme_descriptor, + new java.lang.String[] { "Description", "OpenIdConnectUrl", }); + internal_static_a2a_v1_OAuthFlows_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_a2a_v1_OAuthFlows_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_OAuthFlows_descriptor, + new java.lang.String[] { "AuthorizationCode", "ClientCredentials", "Implicit", "Password", "Flow", }); + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor, + new java.lang.String[] { "AuthorizationUrl", "TokenUrl", "RefreshUrl", "Scopes", }); + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_ScopesEntry_descriptor = + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor.getNestedTypes().get(0); + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_ScopesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_AuthorizationCodeOAuthFlow_ScopesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_a2a_v1_ClientCredentialsOAuthFlow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor, + new java.lang.String[] { "TokenUrl", "RefreshUrl", "Scopes", }); + internal_static_a2a_v1_ClientCredentialsOAuthFlow_ScopesEntry_descriptor = + internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor.getNestedTypes().get(0); + internal_static_a2a_v1_ClientCredentialsOAuthFlow_ScopesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_ClientCredentialsOAuthFlow_ScopesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_a2a_v1_ImplicitOAuthFlow_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_a2a_v1_ImplicitOAuthFlow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_ImplicitOAuthFlow_descriptor, + new java.lang.String[] { "AuthorizationUrl", "RefreshUrl", "Scopes", }); + internal_static_a2a_v1_ImplicitOAuthFlow_ScopesEntry_descriptor = + internal_static_a2a_v1_ImplicitOAuthFlow_descriptor.getNestedTypes().get(0); + internal_static_a2a_v1_ImplicitOAuthFlow_ScopesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_ImplicitOAuthFlow_ScopesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_a2a_v1_PasswordOAuthFlow_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_a2a_v1_PasswordOAuthFlow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_PasswordOAuthFlow_descriptor, + new java.lang.String[] { "TokenUrl", "RefreshUrl", "Scopes", }); + internal_static_a2a_v1_PasswordOAuthFlow_ScopesEntry_descriptor = + internal_static_a2a_v1_PasswordOAuthFlow_descriptor.getNestedTypes().get(0); + internal_static_a2a_v1_PasswordOAuthFlow_ScopesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_PasswordOAuthFlow_ScopesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_a2a_v1_SendMessageRequest_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_a2a_v1_SendMessageRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_SendMessageRequest_descriptor, + new java.lang.String[] { "Request", "Configuration", "Metadata", }); + internal_static_a2a_v1_GetTaskRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_a2a_v1_GetTaskRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_GetTaskRequest_descriptor, + new java.lang.String[] { "Name", "HistoryLength", }); + internal_static_a2a_v1_CancelTaskRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_a2a_v1_CancelTaskRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_CancelTaskRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_descriptor, + new java.lang.String[] { "Parent", "ConfigId", "Config", }); + internal_static_a2a_v1_TaskSubscriptionRequest_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_a2a_v1_TaskSubscriptionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_TaskSubscriptionRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_a2a_v1_GetAgentCardRequest_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_a2a_v1_GetAgentCardRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_GetAgentCardRequest_descriptor, + new java.lang.String[] { }); + internal_static_a2a_v1_SendMessageResponse_descriptor = + getDescriptor().getMessageTypes().get(40); + internal_static_a2a_v1_SendMessageResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_SendMessageResponse_descriptor, + new java.lang.String[] { "Task", "Msg", "Payload", }); + internal_static_a2a_v1_StreamResponse_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_a2a_v1_StreamResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_StreamResponse_descriptor, + new java.lang.String[] { "Task", "Msg", "StatusUpdate", "ArtifactUpdate", "Payload", }); + internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_descriptor, + new java.lang.String[] { "Configs", "NextPageToken", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/grpc/src/main/java/io/a2a/grpc/A2AServiceGrpc.java b/grpc/src/main/java/io/a2a/grpc/A2AServiceGrpc.java new file mode 100644 index 000000000..4ec3a9ac0 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/A2AServiceGrpc.java @@ -0,0 +1,1327 @@ +package io.a2a.grpc; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+ * different shape than the JSONRPC version to better conform to AIP-127,
+ * where appropriate. The nouns are AgentCard, Message, Task and
+ * TaskPushNotificationConfig.
+ * - Messages are not a standard resource so there is no get/delete/update/list
+ *   interface, only a send and stream custom methods.
+ * - Tasks have a get interface and custom cancel and subscribe methods.
+ * - TaskPushNotificationConfig are a resource whose parent is a task.
+ *   They have get, list and create methods.
+ * - AgentCard is a static resource with only a get method.
+ * fields are not present as they don't comply with AIP rules, and the
+ * optional history_length on the get task method is not present as it also
+ * violates AIP-127 and AIP-131.
+ * 
+ */ +// Temporarily comment this out until https://github.com/grpc/grpc-java/pull/12080 is included in a release +//@javax.annotation.Generated( +// value = "by gRPC proto compiler (version 1.73.0)", +// comments = "Source: a2a.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class A2AServiceGrpc { + + private A2AServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "a2a.v1.A2AService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getSendMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendMessage", + requestType = io.a2a.grpc.SendMessageRequest.class, + responseType = io.a2a.grpc.SendMessageResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSendMessageMethod() { + io.grpc.MethodDescriptor getSendMessageMethod; + if ((getSendMessageMethod = A2AServiceGrpc.getSendMessageMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getSendMessageMethod = A2AServiceGrpc.getSendMessageMethod) == null) { + A2AServiceGrpc.getSendMessageMethod = getSendMessageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.SendMessageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.SendMessageResponse.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("SendMessage")) + .build(); + } + } + } + return getSendMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor getSendStreamingMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendStreamingMessage", + requestType = io.a2a.grpc.SendMessageRequest.class, + responseType = io.a2a.grpc.StreamResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getSendStreamingMessageMethod() { + io.grpc.MethodDescriptor getSendStreamingMessageMethod; + if ((getSendStreamingMessageMethod = A2AServiceGrpc.getSendStreamingMessageMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getSendStreamingMessageMethod = A2AServiceGrpc.getSendStreamingMessageMethod) == null) { + A2AServiceGrpc.getSendStreamingMessageMethod = getSendStreamingMessageMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendStreamingMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.SendMessageRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.StreamResponse.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("SendStreamingMessage")) + .build(); + } + } + } + return getSendStreamingMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetTaskMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTask", + requestType = io.a2a.grpc.GetTaskRequest.class, + responseType = io.a2a.grpc.Task.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTaskMethod() { + io.grpc.MethodDescriptor getGetTaskMethod; + if ((getGetTaskMethod = A2AServiceGrpc.getGetTaskMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getGetTaskMethod = A2AServiceGrpc.getGetTaskMethod) == null) { + A2AServiceGrpc.getGetTaskMethod = getGetTaskMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTask")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.GetTaskRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.Task.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("GetTask")) + .build(); + } + } + } + return getGetTaskMethod; + } + + private static volatile io.grpc.MethodDescriptor getCancelTaskMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CancelTask", + requestType = io.a2a.grpc.CancelTaskRequest.class, + responseType = io.a2a.grpc.Task.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCancelTaskMethod() { + io.grpc.MethodDescriptor getCancelTaskMethod; + if ((getCancelTaskMethod = A2AServiceGrpc.getCancelTaskMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getCancelTaskMethod = A2AServiceGrpc.getCancelTaskMethod) == null) { + A2AServiceGrpc.getCancelTaskMethod = getCancelTaskMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CancelTask")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.CancelTaskRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.Task.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("CancelTask")) + .build(); + } + } + } + return getCancelTaskMethod; + } + + private static volatile io.grpc.MethodDescriptor getTaskSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TaskSubscription", + requestType = io.a2a.grpc.TaskSubscriptionRequest.class, + responseType = io.a2a.grpc.StreamResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getTaskSubscriptionMethod() { + io.grpc.MethodDescriptor getTaskSubscriptionMethod; + if ((getTaskSubscriptionMethod = A2AServiceGrpc.getTaskSubscriptionMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getTaskSubscriptionMethod = A2AServiceGrpc.getTaskSubscriptionMethod) == null) { + A2AServiceGrpc.getTaskSubscriptionMethod = getTaskSubscriptionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TaskSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.TaskSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.StreamResponse.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("TaskSubscription")) + .build(); + } + } + } + return getTaskSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateTaskPushNotificationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTaskPushNotificationConfig", + requestType = io.a2a.grpc.CreateTaskPushNotificationConfigRequest.class, + responseType = io.a2a.grpc.TaskPushNotificationConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateTaskPushNotificationConfigMethod() { + io.grpc.MethodDescriptor getCreateTaskPushNotificationConfigMethod; + if ((getCreateTaskPushNotificationConfigMethod = A2AServiceGrpc.getCreateTaskPushNotificationConfigMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getCreateTaskPushNotificationConfigMethod = A2AServiceGrpc.getCreateTaskPushNotificationConfigMethod) == null) { + A2AServiceGrpc.getCreateTaskPushNotificationConfigMethod = getCreateTaskPushNotificationConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTaskPushNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.CreateTaskPushNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("CreateTaskPushNotificationConfig")) + .build(); + } + } + } + return getCreateTaskPushNotificationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetTaskPushNotificationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTaskPushNotificationConfig", + requestType = io.a2a.grpc.GetTaskPushNotificationConfigRequest.class, + responseType = io.a2a.grpc.TaskPushNotificationConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetTaskPushNotificationConfigMethod() { + io.grpc.MethodDescriptor getGetTaskPushNotificationConfigMethod; + if ((getGetTaskPushNotificationConfigMethod = A2AServiceGrpc.getGetTaskPushNotificationConfigMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getGetTaskPushNotificationConfigMethod = A2AServiceGrpc.getGetTaskPushNotificationConfigMethod) == null) { + A2AServiceGrpc.getGetTaskPushNotificationConfigMethod = getGetTaskPushNotificationConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTaskPushNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.GetTaskPushNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("GetTaskPushNotificationConfig")) + .build(); + } + } + } + return getGetTaskPushNotificationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor getListTaskPushNotificationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTaskPushNotificationConfig", + requestType = io.a2a.grpc.ListTaskPushNotificationConfigRequest.class, + responseType = io.a2a.grpc.ListTaskPushNotificationConfigResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListTaskPushNotificationConfigMethod() { + io.grpc.MethodDescriptor getListTaskPushNotificationConfigMethod; + if ((getListTaskPushNotificationConfigMethod = A2AServiceGrpc.getListTaskPushNotificationConfigMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getListTaskPushNotificationConfigMethod = A2AServiceGrpc.getListTaskPushNotificationConfigMethod) == null) { + A2AServiceGrpc.getListTaskPushNotificationConfigMethod = getListTaskPushNotificationConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTaskPushNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.ListTaskPushNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.ListTaskPushNotificationConfigResponse.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("ListTaskPushNotificationConfig")) + .build(); + } + } + } + return getListTaskPushNotificationConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAgentCardMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAgentCard", + requestType = io.a2a.grpc.GetAgentCardRequest.class, + responseType = io.a2a.grpc.AgentCard.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetAgentCardMethod() { + io.grpc.MethodDescriptor getGetAgentCardMethod; + if ((getGetAgentCardMethod = A2AServiceGrpc.getGetAgentCardMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getGetAgentCardMethod = A2AServiceGrpc.getGetAgentCardMethod) == null) { + A2AServiceGrpc.getGetAgentCardMethod = getGetAgentCardMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAgentCard")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.GetAgentCardRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.AgentCard.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("GetAgentCard")) + .build(); + } + } + } + return getGetAgentCardMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteTaskPushNotificationConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTaskPushNotificationConfig", + requestType = io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteTaskPushNotificationConfigMethod() { + io.grpc.MethodDescriptor getDeleteTaskPushNotificationConfigMethod; + if ((getDeleteTaskPushNotificationConfigMethod = A2AServiceGrpc.getDeleteTaskPushNotificationConfigMethod) == null) { + synchronized (A2AServiceGrpc.class) { + if ((getDeleteTaskPushNotificationConfigMethod = A2AServiceGrpc.getDeleteTaskPushNotificationConfigMethod) == null) { + A2AServiceGrpc.getDeleteTaskPushNotificationConfigMethod = getDeleteTaskPushNotificationConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTaskPushNotificationConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("DeleteTaskPushNotificationConfig")) + .build(); + } + } + } + return getDeleteTaskPushNotificationConfigMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static A2AServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public A2AServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceStub(channel, callOptions); + } + }; + return A2AServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports all types of calls on the service + */ + public static A2AServiceBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public A2AServiceBlockingV2Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceBlockingV2Stub(channel, callOptions); + } + }; + return A2AServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static A2AServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public A2AServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceBlockingStub(channel, callOptions); + } + }; + return A2AServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static A2AServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public A2AServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceFutureStub(channel, callOptions); + } + }; + return A2AServiceFutureStub.newStub(factory, channel); + } + + /** + *
+   * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+   * different shape than the JSONRPC version to better conform to AIP-127,
+   * where appropriate. The nouns are AgentCard, Message, Task and
+   * TaskPushNotificationConfig.
+   * - Messages are not a standard resource so there is no get/delete/update/list
+   *   interface, only a send and stream custom methods.
+   * - Tasks have a get interface and custom cancel and subscribe methods.
+   * - TaskPushNotificationConfig are a resource whose parent is a task.
+   *   They have get, list and create methods.
+   * - AgentCard is a static resource with only a get method.
+   * fields are not present as they don't comply with AIP rules, and the
+   * optional history_length on the get task method is not present as it also
+   * violates AIP-127 and AIP-131.
+   * 
+ */ + public interface AsyncService { + + /** + *
+     * Send a message to the agent. This is a blocking call that will return the
+     * task once it is completed, or a LRO if requested.
+     * 
+ */ + default void sendMessage(io.a2a.grpc.SendMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSendMessageMethod(), responseObserver); + } + + /** + *
+     * SendStreamingMessage is a streaming call that will return a stream of
+     * task update events until the Task is in an interrupted or terminal state.
+     * 
+ */ + default void sendStreamingMessage(io.a2a.grpc.SendMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSendStreamingMessageMethod(), responseObserver); + } + + /** + *
+     * Get the current state of a task from the agent.
+     * 
+ */ + default void getTask(io.a2a.grpc.GetTaskRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTaskMethod(), responseObserver); + } + + /** + *
+     * Cancel a task from the agent. If supported one should expect no
+     * more task updates for the task.
+     * 
+ */ + default void cancelTask(io.a2a.grpc.CancelTaskRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCancelTaskMethod(), responseObserver); + } + + /** + *
+     * TaskSubscription is a streaming call that will return a stream of task
+     * update events. This attaches the stream to an existing in process task.
+     * If the task is complete the stream will return the completed task (like
+     * GetTask) and close the stream.
+     * 
+ */ + default void taskSubscription(io.a2a.grpc.TaskSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTaskSubscriptionMethod(), responseObserver); + } + + /** + *
+     * Set a push notification config for a task.
+     * 
+ */ + default void createTaskPushNotificationConfig(io.a2a.grpc.CreateTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateTaskPushNotificationConfigMethod(), responseObserver); + } + + /** + *
+     * Get a push notification config for a task.
+     * 
+ */ + default void getTaskPushNotificationConfig(io.a2a.grpc.GetTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTaskPushNotificationConfigMethod(), responseObserver); + } + + /** + *
+     * Get a list of push notifications configured for a task.
+     * 
+ */ + default void listTaskPushNotificationConfig(io.a2a.grpc.ListTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTaskPushNotificationConfigMethod(), responseObserver); + } + + /** + *
+     * GetAgentCard returns the agent card for the agent.
+     * 
+ */ + default void getAgentCard(io.a2a.grpc.GetAgentCardRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAgentCardMethod(), responseObserver); + } + + /** + *
+     * Delete a push notification config for a task.
+     * 
+ */ + default void deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTaskPushNotificationConfigMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service A2AService. + *
+   * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+   * different shape than the JSONRPC version to better conform to AIP-127,
+   * where appropriate. The nouns are AgentCard, Message, Task and
+   * TaskPushNotificationConfig.
+   * - Messages are not a standard resource so there is no get/delete/update/list
+   *   interface, only a send and stream custom methods.
+   * - Tasks have a get interface and custom cancel and subscribe methods.
+   * - TaskPushNotificationConfig are a resource whose parent is a task.
+   *   They have get, list and create methods.
+   * - AgentCard is a static resource with only a get method.
+   * fields are not present as they don't comply with AIP rules, and the
+   * optional history_length on the get task method is not present as it also
+   * violates AIP-127 and AIP-131.
+   * 
+ */ + public static abstract class A2AServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return A2AServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service A2AService. + *
+   * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+   * different shape than the JSONRPC version to better conform to AIP-127,
+   * where appropriate. The nouns are AgentCard, Message, Task and
+   * TaskPushNotificationConfig.
+   * - Messages are not a standard resource so there is no get/delete/update/list
+   *   interface, only a send and stream custom methods.
+   * - Tasks have a get interface and custom cancel and subscribe methods.
+   * - TaskPushNotificationConfig are a resource whose parent is a task.
+   *   They have get, list and create methods.
+   * - AgentCard is a static resource with only a get method.
+   * fields are not present as they don't comply with AIP rules, and the
+   * optional history_length on the get task method is not present as it also
+   * violates AIP-127 and AIP-131.
+   * 
+ */ + public static final class A2AServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private A2AServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected A2AServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceStub(channel, callOptions); + } + + /** + *
+     * Send a message to the agent. This is a blocking call that will return the
+     * task once it is completed, or a LRO if requested.
+     * 
+ */ + public void sendMessage(io.a2a.grpc.SendMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSendMessageMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * SendStreamingMessage is a streaming call that will return a stream of
+     * task update events until the Task is in an interrupted or terminal state.
+     * 
+ */ + public void sendStreamingMessage(io.a2a.grpc.SendMessageRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getSendStreamingMessageMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get the current state of a task from the agent.
+     * 
+ */ + public void getTask(io.a2a.grpc.GetTaskRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTaskMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Cancel a task from the agent. If supported one should expect no
+     * more task updates for the task.
+     * 
+ */ + public void cancelTask(io.a2a.grpc.CancelTaskRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCancelTaskMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * TaskSubscription is a streaming call that will return a stream of task
+     * update events. This attaches the stream to an existing in process task.
+     * If the task is complete the stream will return the completed task (like
+     * GetTask) and close the stream.
+     * 
+ */ + public void taskSubscription(io.a2a.grpc.TaskSubscriptionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getTaskSubscriptionMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Set a push notification config for a task.
+     * 
+ */ + public void createTaskPushNotificationConfig(io.a2a.grpc.CreateTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTaskPushNotificationConfigMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get a push notification config for a task.
+     * 
+ */ + public void getTaskPushNotificationConfig(io.a2a.grpc.GetTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTaskPushNotificationConfigMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get a list of push notifications configured for a task.
+     * 
+ */ + public void listTaskPushNotificationConfig(io.a2a.grpc.ListTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTaskPushNotificationConfigMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * GetAgentCard returns the agent card for the agent.
+     * 
+ */ + public void getAgentCard(io.a2a.grpc.GetAgentCardRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAgentCardMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Delete a push notification config for a task.
+     * 
+ */ + public void deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTaskPushNotificationConfigMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service A2AService. + *
+   * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+   * different shape than the JSONRPC version to better conform to AIP-127,
+   * where appropriate. The nouns are AgentCard, Message, Task and
+   * TaskPushNotificationConfig.
+   * - Messages are not a standard resource so there is no get/delete/update/list
+   *   interface, only a send and stream custom methods.
+   * - Tasks have a get interface and custom cancel and subscribe methods.
+   * - TaskPushNotificationConfig are a resource whose parent is a task.
+   *   They have get, list and create methods.
+   * - AgentCard is a static resource with only a get method.
+   * fields are not present as they don't comply with AIP rules, and the
+   * optional history_length on the get task method is not present as it also
+   * violates AIP-127 and AIP-131.
+   * 
+ */ + public static final class A2AServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private A2AServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected A2AServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceBlockingV2Stub(channel, callOptions); + } + + /** + *
+     * Send a message to the agent. This is a blocking call that will return the
+     * task once it is completed, or a LRO if requested.
+     * 
+ */ + public io.a2a.grpc.SendMessageResponse sendMessage(io.a2a.grpc.SendMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSendMessageMethod(), getCallOptions(), request); + } + + /** + *
+     * SendStreamingMessage is a streaming call that will return a stream of
+     * task update events until the Task is in an interrupted or terminal state.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + sendStreamingMessage(io.a2a.grpc.SendMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getSendStreamingMessageMethod(), getCallOptions(), request); + } + + /** + *
+     * Get the current state of a task from the agent.
+     * 
+ */ + public io.a2a.grpc.Task getTask(io.a2a.grpc.GetTaskRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTaskMethod(), getCallOptions(), request); + } + + /** + *
+     * Cancel a task from the agent. If supported one should expect no
+     * more task updates for the task.
+     * 
+ */ + public io.a2a.grpc.Task cancelTask(io.a2a.grpc.CancelTaskRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCancelTaskMethod(), getCallOptions(), request); + } + + /** + *
+     * TaskSubscription is a streaming call that will return a stream of task
+     * update events. This attaches the stream to an existing in process task.
+     * If the task is complete the stream will return the completed task (like
+     * GetTask) and close the stream.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + taskSubscription(io.a2a.grpc.TaskSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getTaskSubscriptionMethod(), getCallOptions(), request); + } + + /** + *
+     * Set a push notification config for a task.
+     * 
+ */ + public io.a2a.grpc.TaskPushNotificationConfig createTaskPushNotificationConfig(io.a2a.grpc.CreateTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a push notification config for a task.
+     * 
+ */ + public io.a2a.grpc.TaskPushNotificationConfig getTaskPushNotificationConfig(io.a2a.grpc.GetTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a list of push notifications configured for a task.
+     * 
+ */ + public io.a2a.grpc.ListTaskPushNotificationConfigResponse listTaskPushNotificationConfig(io.a2a.grpc.ListTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + + /** + *
+     * GetAgentCard returns the agent card for the agent.
+     * 
+ */ + public io.a2a.grpc.AgentCard getAgentCard(io.a2a.grpc.GetAgentCardRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAgentCardMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a push notification config for a task.
+     * 
+ */ + public com.google.protobuf.Empty deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service A2AService. + *
+   * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+   * different shape than the JSONRPC version to better conform to AIP-127,
+   * where appropriate. The nouns are AgentCard, Message, Task and
+   * TaskPushNotificationConfig.
+   * - Messages are not a standard resource so there is no get/delete/update/list
+   *   interface, only a send and stream custom methods.
+   * - Tasks have a get interface and custom cancel and subscribe methods.
+   * - TaskPushNotificationConfig are a resource whose parent is a task.
+   *   They have get, list and create methods.
+   * - AgentCard is a static resource with only a get method.
+   * fields are not present as they don't comply with AIP rules, and the
+   * optional history_length on the get task method is not present as it also
+   * violates AIP-127 and AIP-131.
+   * 
+ */ + public static final class A2AServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private A2AServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected A2AServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceBlockingStub(channel, callOptions); + } + + /** + *
+     * Send a message to the agent. This is a blocking call that will return the
+     * task once it is completed, or a LRO if requested.
+     * 
+ */ + public io.a2a.grpc.SendMessageResponse sendMessage(io.a2a.grpc.SendMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSendMessageMethod(), getCallOptions(), request); + } + + /** + *
+     * SendStreamingMessage is a streaming call that will return a stream of
+     * task update events until the Task is in an interrupted or terminal state.
+     * 
+ */ + public java.util.Iterator sendStreamingMessage( + io.a2a.grpc.SendMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getSendStreamingMessageMethod(), getCallOptions(), request); + } + + /** + *
+     * Get the current state of a task from the agent.
+     * 
+ */ + public io.a2a.grpc.Task getTask(io.a2a.grpc.GetTaskRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTaskMethod(), getCallOptions(), request); + } + + /** + *
+     * Cancel a task from the agent. If supported one should expect no
+     * more task updates for the task.
+     * 
+ */ + public io.a2a.grpc.Task cancelTask(io.a2a.grpc.CancelTaskRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCancelTaskMethod(), getCallOptions(), request); + } + + /** + *
+     * TaskSubscription is a streaming call that will return a stream of task
+     * update events. This attaches the stream to an existing in process task.
+     * If the task is complete the stream will return the completed task (like
+     * GetTask) and close the stream.
+     * 
+ */ + public java.util.Iterator taskSubscription( + io.a2a.grpc.TaskSubscriptionRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getTaskSubscriptionMethod(), getCallOptions(), request); + } + + /** + *
+     * Set a push notification config for a task.
+     * 
+ */ + public io.a2a.grpc.TaskPushNotificationConfig createTaskPushNotificationConfig(io.a2a.grpc.CreateTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a push notification config for a task.
+     * 
+ */ + public io.a2a.grpc.TaskPushNotificationConfig getTaskPushNotificationConfig(io.a2a.grpc.GetTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a list of push notifications configured for a task.
+     * 
+ */ + public io.a2a.grpc.ListTaskPushNotificationConfigResponse listTaskPushNotificationConfig(io.a2a.grpc.ListTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + + /** + *
+     * GetAgentCard returns the agent card for the agent.
+     * 
+ */ + public io.a2a.grpc.AgentCard getAgentCard(io.a2a.grpc.GetAgentCardRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAgentCardMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a push notification config for a task.
+     * 
+ */ + public com.google.protobuf.Empty deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTaskPushNotificationConfigMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service A2AService. + *
+   * A2AService defines the gRPC version of the A2A protocol. This has a slightly
+   * different shape than the JSONRPC version to better conform to AIP-127,
+   * where appropriate. The nouns are AgentCard, Message, Task and
+   * TaskPushNotificationConfig.
+   * - Messages are not a standard resource so there is no get/delete/update/list
+   *   interface, only a send and stream custom methods.
+   * - Tasks have a get interface and custom cancel and subscribe methods.
+   * - TaskPushNotificationConfig are a resource whose parent is a task.
+   *   They have get, list and create methods.
+   * - AgentCard is a static resource with only a get method.
+   * fields are not present as they don't comply with AIP rules, and the
+   * optional history_length on the get task method is not present as it also
+   * violates AIP-127 and AIP-131.
+   * 
+ */ + public static final class A2AServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private A2AServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected A2AServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new A2AServiceFutureStub(channel, callOptions); + } + + /** + *
+     * Send a message to the agent. This is a blocking call that will return the
+     * task once it is completed, or a LRO if requested.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture sendMessage( + io.a2a.grpc.SendMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSendMessageMethod(), getCallOptions()), request); + } + + /** + *
+     * Get the current state of a task from the agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getTask( + io.a2a.grpc.GetTaskRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTaskMethod(), getCallOptions()), request); + } + + /** + *
+     * Cancel a task from the agent. If supported one should expect no
+     * more task updates for the task.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture cancelTask( + io.a2a.grpc.CancelTaskRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCancelTaskMethod(), getCallOptions()), request); + } + + /** + *
+     * Set a push notification config for a task.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createTaskPushNotificationConfig( + io.a2a.grpc.CreateTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateTaskPushNotificationConfigMethod(), getCallOptions()), request); + } + + /** + *
+     * Get a push notification config for a task.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getTaskPushNotificationConfig( + io.a2a.grpc.GetTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTaskPushNotificationConfigMethod(), getCallOptions()), request); + } + + /** + *
+     * Get a list of push notifications configured for a task.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listTaskPushNotificationConfig( + io.a2a.grpc.ListTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTaskPushNotificationConfigMethod(), getCallOptions()), request); + } + + /** + *
+     * GetAgentCard returns the agent card for the agent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getAgentCard( + io.a2a.grpc.GetAgentCardRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAgentCardMethod(), getCallOptions()), request); + } + + /** + *
+     * Delete a push notification config for a task.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteTaskPushNotificationConfig( + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTaskPushNotificationConfigMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SEND_MESSAGE = 0; + private static final int METHODID_SEND_STREAMING_MESSAGE = 1; + private static final int METHODID_GET_TASK = 2; + private static final int METHODID_CANCEL_TASK = 3; + private static final int METHODID_TASK_SUBSCRIPTION = 4; + private static final int METHODID_CREATE_TASK_PUSH_NOTIFICATION_CONFIG = 5; + private static final int METHODID_GET_TASK_PUSH_NOTIFICATION_CONFIG = 6; + private static final int METHODID_LIST_TASK_PUSH_NOTIFICATION_CONFIG = 7; + private static final int METHODID_GET_AGENT_CARD = 8; + private static final int METHODID_DELETE_TASK_PUSH_NOTIFICATION_CONFIG = 9; + + 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_SEND_MESSAGE: + serviceImpl.sendMessage((io.a2a.grpc.SendMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SEND_STREAMING_MESSAGE: + serviceImpl.sendStreamingMessage((io.a2a.grpc.SendMessageRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_TASK: + serviceImpl.getTask((io.a2a.grpc.GetTaskRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CANCEL_TASK: + serviceImpl.cancelTask((io.a2a.grpc.CancelTaskRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TASK_SUBSCRIPTION: + serviceImpl.taskSubscription((io.a2a.grpc.TaskSubscriptionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_TASK_PUSH_NOTIFICATION_CONFIG: + serviceImpl.createTaskPushNotificationConfig((io.a2a.grpc.CreateTaskPushNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_TASK_PUSH_NOTIFICATION_CONFIG: + serviceImpl.getTaskPushNotificationConfig((io.a2a.grpc.GetTaskPushNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_TASK_PUSH_NOTIFICATION_CONFIG: + serviceImpl.listTaskPushNotificationConfig((io.a2a.grpc.ListTaskPushNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_AGENT_CARD: + serviceImpl.getAgentCard((io.a2a.grpc.GetAgentCardRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_TASK_PUSH_NOTIFICATION_CONFIG: + serviceImpl.deleteTaskPushNotificationConfig((io.a2a.grpc.DeleteTaskPushNotificationConfigRequest) request, + (io.grpc.stub.StreamObserver) 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( + getSendMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.SendMessageRequest, + io.a2a.grpc.SendMessageResponse>( + service, METHODID_SEND_MESSAGE))) + .addMethod( + getSendStreamingMessageMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.a2a.grpc.SendMessageRequest, + io.a2a.grpc.StreamResponse>( + service, METHODID_SEND_STREAMING_MESSAGE))) + .addMethod( + getGetTaskMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.GetTaskRequest, + io.a2a.grpc.Task>( + service, METHODID_GET_TASK))) + .addMethod( + getCancelTaskMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.CancelTaskRequest, + io.a2a.grpc.Task>( + service, METHODID_CANCEL_TASK))) + .addMethod( + getTaskSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + io.a2a.grpc.TaskSubscriptionRequest, + io.a2a.grpc.StreamResponse>( + service, METHODID_TASK_SUBSCRIPTION))) + .addMethod( + getCreateTaskPushNotificationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.CreateTaskPushNotificationConfigRequest, + io.a2a.grpc.TaskPushNotificationConfig>( + service, METHODID_CREATE_TASK_PUSH_NOTIFICATION_CONFIG))) + .addMethod( + getGetTaskPushNotificationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.GetTaskPushNotificationConfigRequest, + io.a2a.grpc.TaskPushNotificationConfig>( + service, METHODID_GET_TASK_PUSH_NOTIFICATION_CONFIG))) + .addMethod( + getListTaskPushNotificationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.ListTaskPushNotificationConfigRequest, + io.a2a.grpc.ListTaskPushNotificationConfigResponse>( + service, METHODID_LIST_TASK_PUSH_NOTIFICATION_CONFIG))) + .addMethod( + getGetAgentCardMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.GetAgentCardRequest, + io.a2a.grpc.AgentCard>( + service, METHODID_GET_AGENT_CARD))) + .addMethod( + getDeleteTaskPushNotificationConfigMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest, + com.google.protobuf.Empty>( + service, METHODID_DELETE_TASK_PUSH_NOTIFICATION_CONFIG))) + .build(); + } + + private static abstract class A2AServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + A2AServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return io.a2a.grpc.A2A.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("A2AService"); + } + } + + private static final class A2AServiceFileDescriptorSupplier + extends A2AServiceBaseDescriptorSupplier { + A2AServiceFileDescriptorSupplier() {} + } + + private static final class A2AServiceMethodDescriptorSupplier + extends A2AServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + A2AServiceMethodDescriptorSupplier(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 (A2AServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new A2AServiceFileDescriptorSupplier()) + .addMethod(getSendMessageMethod()) + .addMethod(getSendStreamingMessageMethod()) + .addMethod(getGetTaskMethod()) + .addMethod(getCancelTaskMethod()) + .addMethod(getTaskSubscriptionMethod()) + .addMethod(getCreateTaskPushNotificationConfigMethod()) + .addMethod(getGetTaskPushNotificationConfigMethod()) + .addMethod(getListTaskPushNotificationConfigMethod()) + .addMethod(getGetAgentCardMethod()) + .addMethod(getDeleteTaskPushNotificationConfigMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc/src/main/java/io/a2a/grpc/APIKeySecurityScheme.java b/grpc/src/main/java/io/a2a/grpc/APIKeySecurityScheme.java new file mode 100644 index 000000000..f2a9778d6 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/APIKeySecurityScheme.java @@ -0,0 +1,858 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.APIKeySecurityScheme} + */ +@com.google.protobuf.Generated +public final class APIKeySecurityScheme extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.APIKeySecurityScheme) + APIKeySecuritySchemeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + APIKeySecurityScheme.class.getName()); + } + // Use APIKeySecurityScheme.newBuilder() to construct. + private APIKeySecurityScheme(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private APIKeySecurityScheme() { + description_ = ""; + location_ = ""; + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_APIKeySecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_APIKeySecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.APIKeySecurityScheme.class, io.a2a.grpc.APIKeySecurityScheme.Builder.class); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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 LOCATION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + *
+   * Location of the API key, valid values are "query", "header", or "cookie"
+   * 
+ * + * string location = 2 [json_name = "location"]; + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + *
+   * Location of the API key, valid values are "query", "header", or "cookie"
+   * 
+ * + * string location = 2 [json_name = "location"]; + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * Name of the header, query or cookie parameter to be used.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @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; + } + } + /** + *
+   * Name of the header, query or cookie parameter to be used.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @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.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, location_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, location_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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 io.a2a.grpc.APIKeySecurityScheme)) { + return super.equals(obj); + } + io.a2a.grpc.APIKeySecurityScheme other = (io.a2a.grpc.APIKeySecurityScheme) obj; + + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getLocation() + .equals(other.getLocation())) return false; + 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.APIKeySecurityScheme parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.APIKeySecurityScheme parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.APIKeySecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.APIKeySecurityScheme 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.APIKeySecurityScheme} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.APIKeySecurityScheme) + io.a2a.grpc.APIKeySecuritySchemeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_APIKeySecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_APIKeySecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.APIKeySecurityScheme.class, io.a2a.grpc.APIKeySecurityScheme.Builder.class); + } + + // Construct using io.a2a.grpc.APIKeySecurityScheme.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + description_ = ""; + location_ = ""; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_APIKeySecurityScheme_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.APIKeySecurityScheme getDefaultInstanceForType() { + return io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.APIKeySecurityScheme build() { + io.a2a.grpc.APIKeySecurityScheme result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.APIKeySecurityScheme buildPartial() { + io.a2a.grpc.APIKeySecurityScheme result = new io.a2a.grpc.APIKeySecurityScheme(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.APIKeySecurityScheme result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.APIKeySecurityScheme) { + return mergeFrom((io.a2a.grpc.APIKeySecurityScheme)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.APIKeySecurityScheme other) { + if (other == io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + 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: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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.lang.Object description_ = ""; + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + /** + *
+     * Location of the API key, valid values are "query", "header", or "cookie"
+     * 
+ * + * string location = 2 [json_name = "location"]; + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Location of the API key, valid values are "query", "header", or "cookie"
+     * 
+ * + * string location = 2 [json_name = "location"]; + * @return The bytes for location. + */ + public com.google.protobuf.ByteString + getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Location of the API key, valid values are "query", "header", or "cookie"
+     * 
+ * + * string location = 2 [json_name = "location"]; + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Location of the API key, valid values are "query", "header", or "cookie"
+     * 
+ * + * string location = 2 [json_name = "location"]; + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Location of the API key, valid values are "query", "header", or "cookie"
+     * 
+ * + * string location = 2 [json_name = "location"]; + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Name of the header, query or cookie parameter to be used.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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; + } + } + /** + *
+     * Name of the header, query or cookie parameter to be used.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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; + } + } + /** + *
+     * Name of the header, query or cookie parameter to be used.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Name of the header, query or cookie parameter to be used.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Name of the header, query or cookie parameter to be used.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.APIKeySecurityScheme) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.APIKeySecurityScheme) + private static final io.a2a.grpc.APIKeySecurityScheme DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.APIKeySecurityScheme(); + } + + public static io.a2a.grpc.APIKeySecurityScheme getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public APIKeySecurityScheme 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 io.a2a.grpc.APIKeySecurityScheme getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/APIKeySecuritySchemeOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/APIKeySecuritySchemeOrBuilder.java new file mode 100644 index 000000000..ec893f4f8 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/APIKeySecuritySchemeOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface APIKeySecuritySchemeOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.APIKeySecurityScheme) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Location of the API key, valid values are "query", "header", or "cookie"
+   * 
+ * + * string location = 2 [json_name = "location"]; + * @return The location. + */ + java.lang.String getLocation(); + /** + *
+   * Location of the API key, valid values are "query", "header", or "cookie"
+   * 
+ * + * string location = 2 [json_name = "location"]; + * @return The bytes for location. + */ + com.google.protobuf.ByteString + getLocationBytes(); + + /** + *
+   * Name of the header, query or cookie parameter to be used.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Name of the header, query or cookie parameter to be used.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AgentCapabilities.java b/grpc/src/main/java/io/a2a/grpc/AgentCapabilities.java new file mode 100644 index 000000000..ca67660d7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentCapabilities.java @@ -0,0 +1,986 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Defines the A2A feature set supported by the agent
+ * 
+ * + * Protobuf type {@code a2a.v1.AgentCapabilities} + */ +@com.google.protobuf.Generated +public final class AgentCapabilities extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AgentCapabilities) + AgentCapabilitiesOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AgentCapabilities.class.getName()); + } + // Use AgentCapabilities.newBuilder() to construct. + private AgentCapabilities(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AgentCapabilities() { + extensions_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCapabilities_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCapabilities_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentCapabilities.class, io.a2a.grpc.AgentCapabilities.Builder.class); + } + + public static final int STREAMING_FIELD_NUMBER = 1; + private boolean streaming_ = false; + /** + *
+   * If the agent will support streaming responses
+   * 
+ * + * bool streaming = 1 [json_name = "streaming"]; + * @return The streaming. + */ + @java.lang.Override + public boolean getStreaming() { + return streaming_; + } + + public static final int PUSH_NOTIFICATIONS_FIELD_NUMBER = 2; + private boolean pushNotifications_ = false; + /** + *
+   * If the agent can send push notifications to the clients webhook
+   * 
+ * + * bool push_notifications = 2 [json_name = "pushNotifications"]; + * @return The pushNotifications. + */ + @java.lang.Override + public boolean getPushNotifications() { + return pushNotifications_; + } + + public static final int EXTENSIONS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List extensions_; + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + @java.lang.Override + public java.util.List getExtensionsList() { + return extensions_; + } + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + @java.lang.Override + public java.util.List + getExtensionsOrBuilderList() { + return extensions_; + } + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + @java.lang.Override + public int getExtensionsCount() { + return extensions_.size(); + } + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentExtension getExtensions(int index) { + return extensions_.get(index); + } + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentExtensionOrBuilder getExtensionsOrBuilder( + int index) { + return extensions_.get(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 { + if (streaming_ != false) { + output.writeBool(1, streaming_); + } + if (pushNotifications_ != false) { + output.writeBool(2, pushNotifications_); + } + for (int i = 0; i < extensions_.size(); i++) { + output.writeMessage(3, extensions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (streaming_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, streaming_); + } + if (pushNotifications_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, pushNotifications_); + } + for (int i = 0; i < extensions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, extensions_.get(i)); + } + 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 io.a2a.grpc.AgentCapabilities)) { + return super.equals(obj); + } + io.a2a.grpc.AgentCapabilities other = (io.a2a.grpc.AgentCapabilities) obj; + + if (getStreaming() + != other.getStreaming()) return false; + if (getPushNotifications() + != other.getPushNotifications()) return false; + if (!getExtensionsList() + .equals(other.getExtensionsList())) 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) + STREAMING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStreaming()); + hash = (37 * hash) + PUSH_NOTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getPushNotifications()); + if (getExtensionsCount() > 0) { + hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExtensionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AgentCapabilities parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentCapabilities parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentCapabilities parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AgentCapabilities parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AgentCapabilities parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentCapabilities parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AgentCapabilities 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Defines the A2A feature set supported by the agent
+   * 
+ * + * Protobuf type {@code a2a.v1.AgentCapabilities} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AgentCapabilities) + io.a2a.grpc.AgentCapabilitiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCapabilities_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCapabilities_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentCapabilities.class, io.a2a.grpc.AgentCapabilities.Builder.class); + } + + // Construct using io.a2a.grpc.AgentCapabilities.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + streaming_ = false; + pushNotifications_ = false; + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + } else { + extensions_ = null; + extensionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCapabilities_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AgentCapabilities getDefaultInstanceForType() { + return io.a2a.grpc.AgentCapabilities.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AgentCapabilities build() { + io.a2a.grpc.AgentCapabilities result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AgentCapabilities buildPartial() { + io.a2a.grpc.AgentCapabilities result = new io.a2a.grpc.AgentCapabilities(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.a2a.grpc.AgentCapabilities result) { + if (extensionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.extensions_ = extensions_; + } else { + result.extensions_ = extensionsBuilder_.build(); + } + } + + private void buildPartial0(io.a2a.grpc.AgentCapabilities result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.streaming_ = streaming_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pushNotifications_ = pushNotifications_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AgentCapabilities) { + return mergeFrom((io.a2a.grpc.AgentCapabilities)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AgentCapabilities other) { + if (other == io.a2a.grpc.AgentCapabilities.getDefaultInstance()) return this; + if (other.getStreaming() != false) { + setStreaming(other.getStreaming()); + } + if (other.getPushNotifications() != false) { + setPushNotifications(other.getPushNotifications()); + } + if (extensionsBuilder_ == null) { + if (!other.extensions_.isEmpty()) { + if (extensions_.isEmpty()) { + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureExtensionsIsMutable(); + extensions_.addAll(other.extensions_); + } + onChanged(); + } + } else { + if (!other.extensions_.isEmpty()) { + if (extensionsBuilder_.isEmpty()) { + extensionsBuilder_.dispose(); + extensionsBuilder_ = null; + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000004); + extensionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetExtensionsFieldBuilder() : null; + } else { + extensionsBuilder_.addAllMessages(other.extensions_); + } + } + } + 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 8: { + streaming_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + pushNotifications_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: { + io.a2a.grpc.AgentExtension m = + input.readMessage( + io.a2a.grpc.AgentExtension.parser(), + extensionRegistry); + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(m); + } else { + extensionsBuilder_.addMessage(m); + } + 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 boolean streaming_ ; + /** + *
+     * If the agent will support streaming responses
+     * 
+ * + * bool streaming = 1 [json_name = "streaming"]; + * @return The streaming. + */ + @java.lang.Override + public boolean getStreaming() { + return streaming_; + } + /** + *
+     * If the agent will support streaming responses
+     * 
+ * + * bool streaming = 1 [json_name = "streaming"]; + * @param value The streaming to set. + * @return This builder for chaining. + */ + public Builder setStreaming(boolean value) { + + streaming_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * If the agent will support streaming responses
+     * 
+ * + * bool streaming = 1 [json_name = "streaming"]; + * @return This builder for chaining. + */ + public Builder clearStreaming() { + bitField0_ = (bitField0_ & ~0x00000001); + streaming_ = false; + onChanged(); + return this; + } + + private boolean pushNotifications_ ; + /** + *
+     * If the agent can send push notifications to the clients webhook
+     * 
+ * + * bool push_notifications = 2 [json_name = "pushNotifications"]; + * @return The pushNotifications. + */ + @java.lang.Override + public boolean getPushNotifications() { + return pushNotifications_; + } + /** + *
+     * If the agent can send push notifications to the clients webhook
+     * 
+ * + * bool push_notifications = 2 [json_name = "pushNotifications"]; + * @param value The pushNotifications to set. + * @return This builder for chaining. + */ + public Builder setPushNotifications(boolean value) { + + pushNotifications_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * If the agent can send push notifications to the clients webhook
+     * 
+ * + * bool push_notifications = 2 [json_name = "pushNotifications"]; + * @return This builder for chaining. + */ + public Builder clearPushNotifications() { + bitField0_ = (bitField0_ & ~0x00000002); + pushNotifications_ = false; + onChanged(); + return this; + } + + private java.util.List extensions_ = + java.util.Collections.emptyList(); + private void ensureExtensionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + extensions_ = new java.util.ArrayList(extensions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentExtension, io.a2a.grpc.AgentExtension.Builder, io.a2a.grpc.AgentExtensionOrBuilder> extensionsBuilder_; + + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public java.util.List getExtensionsList() { + if (extensionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(extensions_); + } else { + return extensionsBuilder_.getMessageList(); + } + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public int getExtensionsCount() { + if (extensionsBuilder_ == null) { + return extensions_.size(); + } else { + return extensionsBuilder_.getCount(); + } + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public io.a2a.grpc.AgentExtension getExtensions(int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); + } else { + return extensionsBuilder_.getMessage(index); + } + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder setExtensions( + int index, io.a2a.grpc.AgentExtension value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.set(index, value); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder setExtensions( + int index, io.a2a.grpc.AgentExtension.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.set(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder addExtensions(io.a2a.grpc.AgentExtension value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(value); + onChanged(); + } else { + extensionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder addExtensions( + int index, io.a2a.grpc.AgentExtension value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(index, value); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder addExtensions( + io.a2a.grpc.AgentExtension.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder addExtensions( + int index, io.a2a.grpc.AgentExtension.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder addAllExtensions( + java.lang.Iterable values) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, extensions_); + onChanged(); + } else { + extensionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder clearExtensions() { + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + extensionsBuilder_.clear(); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public Builder removeExtensions(int index) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.remove(index); + onChanged(); + } else { + extensionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public io.a2a.grpc.AgentExtension.Builder getExtensionsBuilder( + int index) { + return internalGetExtensionsFieldBuilder().getBuilder(index); + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public io.a2a.grpc.AgentExtensionOrBuilder getExtensionsOrBuilder( + int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); } else { + return extensionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public java.util.List + getExtensionsOrBuilderList() { + if (extensionsBuilder_ != null) { + return extensionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(extensions_); + } + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public io.a2a.grpc.AgentExtension.Builder addExtensionsBuilder() { + return internalGetExtensionsFieldBuilder().addBuilder( + io.a2a.grpc.AgentExtension.getDefaultInstance()); + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public io.a2a.grpc.AgentExtension.Builder addExtensionsBuilder( + int index) { + return internalGetExtensionsFieldBuilder().addBuilder( + index, io.a2a.grpc.AgentExtension.getDefaultInstance()); + } + /** + *
+     * Extensions supported by this agent.
+     * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + public java.util.List + getExtensionsBuilderList() { + return internalGetExtensionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentExtension, io.a2a.grpc.AgentExtension.Builder, io.a2a.grpc.AgentExtensionOrBuilder> + internalGetExtensionsFieldBuilder() { + if (extensionsBuilder_ == null) { + extensionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentExtension, io.a2a.grpc.AgentExtension.Builder, io.a2a.grpc.AgentExtensionOrBuilder>( + extensions_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + extensions_ = null; + } + return extensionsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AgentCapabilities) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AgentCapabilities) + private static final io.a2a.grpc.AgentCapabilities DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AgentCapabilities(); + } + + public static io.a2a.grpc.AgentCapabilities getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AgentCapabilities 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 io.a2a.grpc.AgentCapabilities getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AgentCapabilitiesOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AgentCapabilitiesOrBuilder.java new file mode 100644 index 000000000..311841ae9 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentCapabilitiesOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AgentCapabilitiesOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AgentCapabilities) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If the agent will support streaming responses
+   * 
+ * + * bool streaming = 1 [json_name = "streaming"]; + * @return The streaming. + */ + boolean getStreaming(); + + /** + *
+   * If the agent can send push notifications to the clients webhook
+   * 
+ * + * bool push_notifications = 2 [json_name = "pushNotifications"]; + * @return The pushNotifications. + */ + boolean getPushNotifications(); + + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + java.util.List + getExtensionsList(); + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + io.a2a.grpc.AgentExtension getExtensions(int index); + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + int getExtensionsCount(); + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + java.util.List + getExtensionsOrBuilderList(); + /** + *
+   * Extensions supported by this agent.
+   * 
+ * + * repeated .a2a.v1.AgentExtension extensions = 3 [json_name = "extensions"]; + */ + io.a2a.grpc.AgentExtensionOrBuilder getExtensionsOrBuilder( + int index); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AgentCard.java b/grpc/src/main/java/io/a2a/grpc/AgentCard.java new file mode 100644 index 000000000..8327b6376 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentCard.java @@ -0,0 +1,4410 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * AgentCard conveys key information:
+ * - Overall details (version, name, description, uses)
+ * - Skills; a set of actions/solutions the agent can perform
+ * - Default modalities/content types supported by the agent.
+ * - Authentication requirements
+ * 
+ * + * Protobuf type {@code a2a.v1.AgentCard} + */ +@com.google.protobuf.Generated +public final class AgentCard extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AgentCard) + AgentCardOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AgentCard.class.getName()); + } + // Use AgentCard.newBuilder() to construct. + private AgentCard(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AgentCard() { + protocolVersion_ = ""; + name_ = ""; + description_ = ""; + url_ = ""; + preferredTransport_ = ""; + additionalInterfaces_ = java.util.Collections.emptyList(); + version_ = ""; + documentationUrl_ = ""; + security_ = java.util.Collections.emptyList(); + defaultInputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + defaultOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + skills_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCard_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetSecuritySchemes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentCard.class, io.a2a.grpc.AgentCard.Builder.class); + } + + private int bitField0_; + public static final int PROTOCOL_VERSION_FIELD_NUMBER = 16; + @SuppressWarnings("serial") + private volatile java.lang.Object protocolVersion_ = ""; + /** + *
+   * The version of the A2A protocol this agent supports.
+   * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return The protocolVersion. + */ + @java.lang.Override + public java.lang.String getProtocolVersion() { + java.lang.Object ref = protocolVersion_; + 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(); + protocolVersion_ = s; + return s; + } + } + /** + *
+   * The version of the A2A protocol this agent supports.
+   * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return The bytes for protocolVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getProtocolVersionBytes() { + java.lang.Object ref = protocolVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocolVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * A human readable name for the agent.
+   * Example: "Recipe Agent"
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+   * A human readable name for the agent.
+   * Example: "Recipe Agent"
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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 DESCRIPTION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * A description of the agent's domain of action/solution space.
+   * Example: "Agent that helps users with recipes and cooking."
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of the agent's domain of action/solution space.
+   * Example: "Agent that helps users with recipes and cooking."
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @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 URL_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + *
+   * A URL to the address the agent is hosted at. This represents the
+   * preferred endpoint as declared by the agent.
+   * 
+ * + * string url = 3 [json_name = "url"]; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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(); + url_ = s; + return s; + } + } + /** + *
+   * A URL to the address the agent is hosted at. This represents the
+   * preferred endpoint as declared by the agent.
+   * 
+ * + * string url = 3 [json_name = "url"]; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFERRED_TRANSPORT_FIELD_NUMBER = 14; + @SuppressWarnings("serial") + private volatile java.lang.Object preferredTransport_ = ""; + /** + *
+   * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+   * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return The preferredTransport. + */ + @java.lang.Override + public java.lang.String getPreferredTransport() { + java.lang.Object ref = preferredTransport_; + 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(); + preferredTransport_ = s; + return s; + } + } + /** + *
+   * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+   * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return The bytes for preferredTransport. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPreferredTransportBytes() { + java.lang.Object ref = preferredTransport_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + preferredTransport_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADDITIONAL_INTERFACES_FIELD_NUMBER = 15; + @SuppressWarnings("serial") + private java.util.List additionalInterfaces_; + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + @java.lang.Override + public java.util.List getAdditionalInterfacesList() { + return additionalInterfaces_; + } + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + @java.lang.Override + public java.util.List + getAdditionalInterfacesOrBuilderList() { + return additionalInterfaces_; + } + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + @java.lang.Override + public int getAdditionalInterfacesCount() { + return additionalInterfaces_.size(); + } + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentInterface getAdditionalInterfaces(int index) { + return additionalInterfaces_.get(index); + } + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentInterfaceOrBuilder getAdditionalInterfacesOrBuilder( + int index) { + return additionalInterfaces_.get(index); + } + + public static final int PROVIDER_FIELD_NUMBER = 4; + private io.a2a.grpc.AgentProvider provider_; + /** + *
+   * The service provider of the agent.
+   * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + * @return Whether the provider field is set. + */ + @java.lang.Override + public boolean hasProvider() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The service provider of the agent.
+   * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + * @return The provider. + */ + @java.lang.Override + public io.a2a.grpc.AgentProvider getProvider() { + return provider_ == null ? io.a2a.grpc.AgentProvider.getDefaultInstance() : provider_; + } + /** + *
+   * The service provider of the agent.
+   * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentProviderOrBuilder getProviderOrBuilder() { + return provider_ == null ? io.a2a.grpc.AgentProvider.getDefaultInstance() : provider_; + } + + public static final int VERSION_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** + *
+   * The version of the agent.
+   * Example: "1.0.0"
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + *
+   * The version of the agent.
+   * Example: "1.0.0"
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENTATION_URL_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object documentationUrl_ = ""; + /** + *
+   * A url to provide additional documentation about the agent.
+   * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return The documentationUrl. + */ + @java.lang.Override + public java.lang.String getDocumentationUrl() { + java.lang.Object ref = documentationUrl_; + 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(); + documentationUrl_ = s; + return s; + } + } + /** + *
+   * A url to provide additional documentation about the agent.
+   * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return The bytes for documentationUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDocumentationUrlBytes() { + java.lang.Object ref = documentationUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + documentationUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CAPABILITIES_FIELD_NUMBER = 7; + private io.a2a.grpc.AgentCapabilities capabilities_; + /** + *
+   * A2A Capability set supported by the agent.
+   * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + * @return Whether the capabilities field is set. + */ + @java.lang.Override + public boolean hasCapabilities() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * A2A Capability set supported by the agent.
+   * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + * @return The capabilities. + */ + @java.lang.Override + public io.a2a.grpc.AgentCapabilities getCapabilities() { + return capabilities_ == null ? io.a2a.grpc.AgentCapabilities.getDefaultInstance() : capabilities_; + } + /** + *
+   * A2A Capability set supported by the agent.
+   * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentCapabilitiesOrBuilder getCapabilitiesOrBuilder() { + return capabilities_ == null ? io.a2a.grpc.AgentCapabilities.getDefaultInstance() : capabilities_; + } + + public static final int SECURITY_SCHEMES_FIELD_NUMBER = 8; + private static final class SecuritySchemesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.a2a.grpc.SecurityScheme> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCard_SecuritySchemesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.a2a.grpc.SecurityScheme.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, io.a2a.grpc.SecurityScheme> securitySchemes_; + private com.google.protobuf.MapField + internalGetSecuritySchemes() { + if (securitySchemes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SecuritySchemesDefaultEntryHolder.defaultEntry); + } + return securitySchemes_; + } + public int getSecuritySchemesCount() { + return internalGetSecuritySchemes().getMap().size(); + } + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public boolean containsSecuritySchemes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSecuritySchemes().getMap().containsKey(key); + } + /** + * Use {@link #getSecuritySchemesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSecuritySchemes() { + return getSecuritySchemesMap(); + } + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public java.util.Map getSecuritySchemesMap() { + return internalGetSecuritySchemes().getMap(); + } + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public /* nullable */ +io.a2a.grpc.SecurityScheme getSecuritySchemesOrDefault( + java.lang.String key, + /* nullable */ +io.a2a.grpc.SecurityScheme defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSecuritySchemes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public io.a2a.grpc.SecurityScheme getSecuritySchemesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSecuritySchemes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SECURITY_FIELD_NUMBER = 9; + @SuppressWarnings("serial") + private java.util.List security_; + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + @java.lang.Override + public java.util.List getSecurityList() { + return security_; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + @java.lang.Override + public java.util.List + getSecurityOrBuilderList() { + return security_; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + @java.lang.Override + public int getSecurityCount() { + return security_.size(); + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + @java.lang.Override + public io.a2a.grpc.Security getSecurity(int index) { + return security_.get(index); + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + @java.lang.Override + public io.a2a.grpc.SecurityOrBuilder getSecurityOrBuilder( + int index) { + return security_.get(index); + } + + public static final int DEFAULT_INPUT_MODES_FIELD_NUMBER = 10; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList defaultInputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return A list containing the defaultInputModes. + */ + public com.google.protobuf.ProtocolStringList + getDefaultInputModesList() { + return defaultInputModes_; + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return The count of defaultInputModes. + */ + public int getDefaultInputModesCount() { + return defaultInputModes_.size(); + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index of the element to return. + * @return The defaultInputModes at the given index. + */ + public java.lang.String getDefaultInputModes(int index) { + return defaultInputModes_.get(index); + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index of the value to return. + * @return The bytes of the defaultInputModes at the given index. + */ + public com.google.protobuf.ByteString + getDefaultInputModesBytes(int index) { + return defaultInputModes_.getByteString(index); + } + + public static final int DEFAULT_OUTPUT_MODES_FIELD_NUMBER = 11; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList defaultOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return A list containing the defaultOutputModes. + */ + public com.google.protobuf.ProtocolStringList + getDefaultOutputModesList() { + return defaultOutputModes_; + } + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return The count of defaultOutputModes. + */ + public int getDefaultOutputModesCount() { + return defaultOutputModes_.size(); + } + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index of the element to return. + * @return The defaultOutputModes at the given index. + */ + public java.lang.String getDefaultOutputModes(int index) { + return defaultOutputModes_.get(index); + } + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index of the value to return. + * @return The bytes of the defaultOutputModes at the given index. + */ + public com.google.protobuf.ByteString + getDefaultOutputModesBytes(int index) { + return defaultOutputModes_.getByteString(index); + } + + public static final int SKILLS_FIELD_NUMBER = 12; + @SuppressWarnings("serial") + private java.util.List skills_; + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + @java.lang.Override + public java.util.List getSkillsList() { + return skills_; + } + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + @java.lang.Override + public java.util.List + getSkillsOrBuilderList() { + return skills_; + } + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + @java.lang.Override + public int getSkillsCount() { + return skills_.size(); + } + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentSkill getSkills(int index) { + return skills_.get(index); + } + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + @java.lang.Override + public io.a2a.grpc.AgentSkillOrBuilder getSkillsOrBuilder( + int index) { + return skills_.get(index); + } + + public static final int SUPPORTS_AUTHENTICATED_EXTENDED_CARD_FIELD_NUMBER = 13; + private boolean supportsAuthenticatedExtendedCard_ = false; + /** + *
+   * Whether the agent supports providing an extended agent card when
+   * the user is authenticated, i.e. is the card from .well-known
+   * different than the card from GetAgentCard.
+   * 
+ * + * bool supports_authenticated_extended_card = 13 [json_name = "supportsAuthenticatedExtendedCard"]; + * @return The supportsAuthenticatedExtendedCard. + */ + @java.lang.Override + public boolean getSupportsAuthenticatedExtendedCard() { + return supportsAuthenticatedExtendedCard_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, url_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getProvider()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, version_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(documentationUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, documentationUrl_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getCapabilities()); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetSecuritySchemes(), + SecuritySchemesDefaultEntryHolder.defaultEntry, + 8); + for (int i = 0; i < security_.size(); i++) { + output.writeMessage(9, security_.get(i)); + } + for (int i = 0; i < defaultInputModes_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, defaultInputModes_.getRaw(i)); + } + for (int i = 0; i < defaultOutputModes_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, defaultOutputModes_.getRaw(i)); + } + for (int i = 0; i < skills_.size(); i++) { + output.writeMessage(12, skills_.get(i)); + } + if (supportsAuthenticatedExtendedCard_ != false) { + output.writeBool(13, supportsAuthenticatedExtendedCard_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(preferredTransport_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, preferredTransport_); + } + for (int i = 0; i < additionalInterfaces_.size(); i++) { + output.writeMessage(15, additionalInterfaces_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocolVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 16, protocolVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, url_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getProvider()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, version_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(documentationUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, documentationUrl_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getCapabilities()); + } + for (java.util.Map.Entry entry + : internalGetSecuritySchemes().getMap().entrySet()) { + com.google.protobuf.MapEntry + securitySchemes__ = SecuritySchemesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, securitySchemes__); + } + for (int i = 0; i < security_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, security_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < defaultInputModes_.size(); i++) { + dataSize += computeStringSizeNoTag(defaultInputModes_.getRaw(i)); + } + size += dataSize; + size += 1 * getDefaultInputModesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < defaultOutputModes_.size(); i++) { + dataSize += computeStringSizeNoTag(defaultOutputModes_.getRaw(i)); + } + size += dataSize; + size += 1 * getDefaultOutputModesList().size(); + } + for (int i = 0; i < skills_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, skills_.get(i)); + } + if (supportsAuthenticatedExtendedCard_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, supportsAuthenticatedExtendedCard_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(preferredTransport_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, preferredTransport_); + } + for (int i = 0; i < additionalInterfaces_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, additionalInterfaces_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocolVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(16, protocolVersion_); + } + 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 io.a2a.grpc.AgentCard)) { + return super.equals(obj); + } + io.a2a.grpc.AgentCard other = (io.a2a.grpc.AgentCard) obj; + + if (!getProtocolVersion() + .equals(other.getProtocolVersion())) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUrl() + .equals(other.getUrl())) return false; + if (!getPreferredTransport() + .equals(other.getPreferredTransport())) return false; + if (!getAdditionalInterfacesList() + .equals(other.getAdditionalInterfacesList())) return false; + if (hasProvider() != other.hasProvider()) return false; + if (hasProvider()) { + if (!getProvider() + .equals(other.getProvider())) return false; + } + if (!getVersion() + .equals(other.getVersion())) return false; + if (!getDocumentationUrl() + .equals(other.getDocumentationUrl())) return false; + if (hasCapabilities() != other.hasCapabilities()) return false; + if (hasCapabilities()) { + if (!getCapabilities() + .equals(other.getCapabilities())) return false; + } + if (!internalGetSecuritySchemes().equals( + other.internalGetSecuritySchemes())) return false; + if (!getSecurityList() + .equals(other.getSecurityList())) return false; + if (!getDefaultInputModesList() + .equals(other.getDefaultInputModesList())) return false; + if (!getDefaultOutputModesList() + .equals(other.getDefaultOutputModesList())) return false; + if (!getSkillsList() + .equals(other.getSkillsList())) return false; + if (getSupportsAuthenticatedExtendedCard() + != other.getSupportsAuthenticatedExtendedCard()) 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) + PROTOCOL_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getProtocolVersion().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + PREFERRED_TRANSPORT_FIELD_NUMBER; + hash = (53 * hash) + getPreferredTransport().hashCode(); + if (getAdditionalInterfacesCount() > 0) { + hash = (37 * hash) + ADDITIONAL_INTERFACES_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalInterfacesList().hashCode(); + } + if (hasProvider()) { + hash = (37 * hash) + PROVIDER_FIELD_NUMBER; + hash = (53 * hash) + getProvider().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + DOCUMENTATION_URL_FIELD_NUMBER; + hash = (53 * hash) + getDocumentationUrl().hashCode(); + if (hasCapabilities()) { + hash = (37 * hash) + CAPABILITIES_FIELD_NUMBER; + hash = (53 * hash) + getCapabilities().hashCode(); + } + if (!internalGetSecuritySchemes().getMap().isEmpty()) { + hash = (37 * hash) + SECURITY_SCHEMES_FIELD_NUMBER; + hash = (53 * hash) + internalGetSecuritySchemes().hashCode(); + } + if (getSecurityCount() > 0) { + hash = (37 * hash) + SECURITY_FIELD_NUMBER; + hash = (53 * hash) + getSecurityList().hashCode(); + } + if (getDefaultInputModesCount() > 0) { + hash = (37 * hash) + DEFAULT_INPUT_MODES_FIELD_NUMBER; + hash = (53 * hash) + getDefaultInputModesList().hashCode(); + } + if (getDefaultOutputModesCount() > 0) { + hash = (37 * hash) + DEFAULT_OUTPUT_MODES_FIELD_NUMBER; + hash = (53 * hash) + getDefaultOutputModesList().hashCode(); + } + if (getSkillsCount() > 0) { + hash = (37 * hash) + SKILLS_FIELD_NUMBER; + hash = (53 * hash) + getSkillsList().hashCode(); + } + hash = (37 * hash) + SUPPORTS_AUTHENTICATED_EXTENDED_CARD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSupportsAuthenticatedExtendedCard()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AgentCard parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentCard parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentCard parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentCard parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentCard parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentCard parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentCard parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentCard parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AgentCard parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AgentCard parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AgentCard parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentCard parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AgentCard 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * AgentCard conveys key information:
+   * - Overall details (version, name, description, uses)
+   * - Skills; a set of actions/solutions the agent can perform
+   * - Default modalities/content types supported by the agent.
+   * - Authentication requirements
+   * 
+ * + * Protobuf type {@code a2a.v1.AgentCard} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AgentCard) + io.a2a.grpc.AgentCardOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCard_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetSecuritySchemes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetMutableSecuritySchemes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentCard.class, io.a2a.grpc.AgentCard.Builder.class); + } + + // Construct using io.a2a.grpc.AgentCard.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetAdditionalInterfacesFieldBuilder(); + internalGetProviderFieldBuilder(); + internalGetCapabilitiesFieldBuilder(); + internalGetSecurityFieldBuilder(); + internalGetSkillsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + protocolVersion_ = ""; + name_ = ""; + description_ = ""; + url_ = ""; + preferredTransport_ = ""; + if (additionalInterfacesBuilder_ == null) { + additionalInterfaces_ = java.util.Collections.emptyList(); + } else { + additionalInterfaces_ = null; + additionalInterfacesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + provider_ = null; + if (providerBuilder_ != null) { + providerBuilder_.dispose(); + providerBuilder_ = null; + } + version_ = ""; + documentationUrl_ = ""; + capabilities_ = null; + if (capabilitiesBuilder_ != null) { + capabilitiesBuilder_.dispose(); + capabilitiesBuilder_ = null; + } + internalGetMutableSecuritySchemes().clear(); + if (securityBuilder_ == null) { + security_ = java.util.Collections.emptyList(); + } else { + security_ = null; + securityBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + defaultInputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + defaultOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + if (skillsBuilder_ == null) { + skills_ = java.util.Collections.emptyList(); + } else { + skills_ = null; + skillsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00004000); + supportsAuthenticatedExtendedCard_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentCard_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AgentCard getDefaultInstanceForType() { + return io.a2a.grpc.AgentCard.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AgentCard build() { + io.a2a.grpc.AgentCard result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AgentCard buildPartial() { + io.a2a.grpc.AgentCard result = new io.a2a.grpc.AgentCard(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.a2a.grpc.AgentCard result) { + if (additionalInterfacesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + additionalInterfaces_ = java.util.Collections.unmodifiableList(additionalInterfaces_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.additionalInterfaces_ = additionalInterfaces_; + } else { + result.additionalInterfaces_ = additionalInterfacesBuilder_.build(); + } + if (securityBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + security_ = java.util.Collections.unmodifiableList(security_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.security_ = security_; + } else { + result.security_ = securityBuilder_.build(); + } + if (skillsBuilder_ == null) { + if (((bitField0_ & 0x00004000) != 0)) { + skills_ = java.util.Collections.unmodifiableList(skills_); + bitField0_ = (bitField0_ & ~0x00004000); + } + result.skills_ = skills_; + } else { + result.skills_ = skillsBuilder_.build(); + } + } + + private void buildPartial0(io.a2a.grpc.AgentCard result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.protocolVersion_ = protocolVersion_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.url_ = url_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.preferredTransport_ = preferredTransport_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.provider_ = providerBuilder_ == null + ? provider_ + : providerBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.documentationUrl_ = documentationUrl_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.capabilities_ = capabilitiesBuilder_ == null + ? capabilities_ + : capabilitiesBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.securitySchemes_ = internalGetSecuritySchemes().build(SecuritySchemesDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + defaultInputModes_.makeImmutable(); + result.defaultInputModes_ = defaultInputModes_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + defaultOutputModes_.makeImmutable(); + result.defaultOutputModes_ = defaultOutputModes_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.supportsAuthenticatedExtendedCard_ = supportsAuthenticatedExtendedCard_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AgentCard) { + return mergeFrom((io.a2a.grpc.AgentCard)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AgentCard other) { + if (other == io.a2a.grpc.AgentCard.getDefaultInstance()) return this; + if (!other.getProtocolVersion().isEmpty()) { + protocolVersion_ = other.protocolVersion_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getPreferredTransport().isEmpty()) { + preferredTransport_ = other.preferredTransport_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (additionalInterfacesBuilder_ == null) { + if (!other.additionalInterfaces_.isEmpty()) { + if (additionalInterfaces_.isEmpty()) { + additionalInterfaces_ = other.additionalInterfaces_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.addAll(other.additionalInterfaces_); + } + onChanged(); + } + } else { + if (!other.additionalInterfaces_.isEmpty()) { + if (additionalInterfacesBuilder_.isEmpty()) { + additionalInterfacesBuilder_.dispose(); + additionalInterfacesBuilder_ = null; + additionalInterfaces_ = other.additionalInterfaces_; + bitField0_ = (bitField0_ & ~0x00000020); + additionalInterfacesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetAdditionalInterfacesFieldBuilder() : null; + } else { + additionalInterfacesBuilder_.addAllMessages(other.additionalInterfaces_); + } + } + } + if (other.hasProvider()) { + mergeProvider(other.getProvider()); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getDocumentationUrl().isEmpty()) { + documentationUrl_ = other.documentationUrl_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasCapabilities()) { + mergeCapabilities(other.getCapabilities()); + } + internalGetMutableSecuritySchemes().mergeFrom( + other.internalGetSecuritySchemes()); + bitField0_ |= 0x00000400; + if (securityBuilder_ == null) { + if (!other.security_.isEmpty()) { + if (security_.isEmpty()) { + security_ = other.security_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureSecurityIsMutable(); + security_.addAll(other.security_); + } + onChanged(); + } + } else { + if (!other.security_.isEmpty()) { + if (securityBuilder_.isEmpty()) { + securityBuilder_.dispose(); + securityBuilder_ = null; + security_ = other.security_; + bitField0_ = (bitField0_ & ~0x00000800); + securityBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetSecurityFieldBuilder() : null; + } else { + securityBuilder_.addAllMessages(other.security_); + } + } + } + if (!other.defaultInputModes_.isEmpty()) { + if (defaultInputModes_.isEmpty()) { + defaultInputModes_ = other.defaultInputModes_; + bitField0_ |= 0x00001000; + } else { + ensureDefaultInputModesIsMutable(); + defaultInputModes_.addAll(other.defaultInputModes_); + } + onChanged(); + } + if (!other.defaultOutputModes_.isEmpty()) { + if (defaultOutputModes_.isEmpty()) { + defaultOutputModes_ = other.defaultOutputModes_; + bitField0_ |= 0x00002000; + } else { + ensureDefaultOutputModesIsMutable(); + defaultOutputModes_.addAll(other.defaultOutputModes_); + } + onChanged(); + } + if (skillsBuilder_ == null) { + if (!other.skills_.isEmpty()) { + if (skills_.isEmpty()) { + skills_ = other.skills_; + bitField0_ = (bitField0_ & ~0x00004000); + } else { + ensureSkillsIsMutable(); + skills_.addAll(other.skills_); + } + onChanged(); + } + } else { + if (!other.skills_.isEmpty()) { + if (skillsBuilder_.isEmpty()) { + skillsBuilder_.dispose(); + skillsBuilder_ = null; + skills_ = other.skills_; + bitField0_ = (bitField0_ & ~0x00004000); + skillsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetSkillsFieldBuilder() : null; + } else { + skillsBuilder_.addAllMessages(other.skills_); + } + } + } + if (other.getSupportsAuthenticatedExtendedCard() != false) { + setSupportsAuthenticatedExtendedCard(other.getSupportsAuthenticatedExtendedCard()); + } + 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_ |= 0x00000002; + break; + } // case 10 + case 18: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: { + input.readMessage( + internalGetProviderFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 34 + case 42: { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 42 + case 50: { + documentationUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 50 + case 58: { + input.readMessage( + internalGetCapabilitiesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 58 + case 66: { + com.google.protobuf.MapEntry + securitySchemes__ = input.readMessage( + SecuritySchemesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableSecuritySchemes().ensureBuilderMap().put( + securitySchemes__.getKey(), securitySchemes__.getValue()); + bitField0_ |= 0x00000400; + break; + } // case 66 + case 74: { + io.a2a.grpc.Security m = + input.readMessage( + io.a2a.grpc.Security.parser(), + extensionRegistry); + if (securityBuilder_ == null) { + ensureSecurityIsMutable(); + security_.add(m); + } else { + securityBuilder_.addMessage(m); + } + break; + } // case 74 + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + ensureDefaultInputModesIsMutable(); + defaultInputModes_.add(s); + break; + } // case 82 + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + ensureDefaultOutputModesIsMutable(); + defaultOutputModes_.add(s); + break; + } // case 90 + case 98: { + io.a2a.grpc.AgentSkill m = + input.readMessage( + io.a2a.grpc.AgentSkill.parser(), + extensionRegistry); + if (skillsBuilder_ == null) { + ensureSkillsIsMutable(); + skills_.add(m); + } else { + skillsBuilder_.addMessage(m); + } + break; + } // case 98 + case 104: { + supportsAuthenticatedExtendedCard_ = input.readBool(); + bitField0_ |= 0x00008000; + break; + } // case 104 + case 114: { + preferredTransport_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 114 + case 122: { + io.a2a.grpc.AgentInterface m = + input.readMessage( + io.a2a.grpc.AgentInterface.parser(), + extensionRegistry); + if (additionalInterfacesBuilder_ == null) { + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.add(m); + } else { + additionalInterfacesBuilder_.addMessage(m); + } + break; + } // case 122 + case 130: { + protocolVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 130 + 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 protocolVersion_ = ""; + /** + *
+     * The version of the A2A protocol this agent supports.
+     * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return The protocolVersion. + */ + public java.lang.String getProtocolVersion() { + java.lang.Object ref = protocolVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protocolVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The version of the A2A protocol this agent supports.
+     * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return The bytes for protocolVersion. + */ + public com.google.protobuf.ByteString + getProtocolVersionBytes() { + java.lang.Object ref = protocolVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + protocolVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The version of the A2A protocol this agent supports.
+     * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @param value The protocolVersion to set. + * @return This builder for chaining. + */ + public Builder setProtocolVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + protocolVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The version of the A2A protocol this agent supports.
+     * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return This builder for chaining. + */ + public Builder clearProtocolVersion() { + protocolVersion_ = getDefaultInstance().getProtocolVersion(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The version of the A2A protocol this agent supports.
+     * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @param value The bytes for protocolVersion to set. + * @return This builder for chaining. + */ + public Builder setProtocolVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + protocolVersion_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * A human readable name for the agent.
+     * Example: "Recipe Agent"
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * A human readable name for the agent.
+     * Example: "Recipe Agent"
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * A human readable name for the agent.
+     * Example: "Recipe Agent"
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A human readable name for the agent.
+     * Example: "Recipe Agent"
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A human readable name for the agent.
+     * Example: "Recipe Agent"
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * A description of the agent's domain of action/solution space.
+     * Example: "Agent that helps users with recipes and cooking."
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of the agent's domain of action/solution space.
+     * Example: "Agent that helps users with recipes and cooking."
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of the agent's domain of action/solution space.
+     * Example: "Agent that helps users with recipes and cooking."
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of the agent's domain of action/solution space.
+     * Example: "Agent that helps users with recipes and cooking."
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * A description of the agent's domain of action/solution space.
+     * Example: "Agent that helps users with recipes and cooking."
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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 java.lang.Object url_ = ""; + /** + *
+     * A URL to the address the agent is hosted at. This represents the
+     * preferred endpoint as declared by the agent.
+     * 
+ * + * string url = 3 [json_name = "url"]; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A URL to the address the agent is hosted at. This represents the
+     * preferred endpoint as declared by the agent.
+     * 
+ * + * string url = 3 [json_name = "url"]; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A URL to the address the agent is hosted at. This represents the
+     * preferred endpoint as declared by the agent.
+     * 
+ * + * string url = 3 [json_name = "url"]; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + url_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * A URL to the address the agent is hosted at. This represents the
+     * preferred endpoint as declared by the agent.
+     * 
+ * + * string url = 3 [json_name = "url"]; + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + *
+     * A URL to the address the agent is hosted at. This represents the
+     * preferred endpoint as declared by the agent.
+     * 
+ * + * string url = 3 [json_name = "url"]; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object preferredTransport_ = ""; + /** + *
+     * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+     * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return The preferredTransport. + */ + public java.lang.String getPreferredTransport() { + java.lang.Object ref = preferredTransport_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + preferredTransport_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+     * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return The bytes for preferredTransport. + */ + public com.google.protobuf.ByteString + getPreferredTransportBytes() { + java.lang.Object ref = preferredTransport_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + preferredTransport_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+     * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @param value The preferredTransport to set. + * @return This builder for chaining. + */ + public Builder setPreferredTransport( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + preferredTransport_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+     * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return This builder for chaining. + */ + public Builder clearPreferredTransport() { + preferredTransport_ = getDefaultInstance().getPreferredTransport(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + *
+     * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+     * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @param value The bytes for preferredTransport to set. + * @return This builder for chaining. + */ + public Builder setPreferredTransportBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + preferredTransport_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.util.List additionalInterfaces_ = + java.util.Collections.emptyList(); + private void ensureAdditionalInterfacesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + additionalInterfaces_ = new java.util.ArrayList(additionalInterfaces_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentInterface, io.a2a.grpc.AgentInterface.Builder, io.a2a.grpc.AgentInterfaceOrBuilder> additionalInterfacesBuilder_; + + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public java.util.List getAdditionalInterfacesList() { + if (additionalInterfacesBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalInterfaces_); + } else { + return additionalInterfacesBuilder_.getMessageList(); + } + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public int getAdditionalInterfacesCount() { + if (additionalInterfacesBuilder_ == null) { + return additionalInterfaces_.size(); + } else { + return additionalInterfacesBuilder_.getCount(); + } + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public io.a2a.grpc.AgentInterface getAdditionalInterfaces(int index) { + if (additionalInterfacesBuilder_ == null) { + return additionalInterfaces_.get(index); + } else { + return additionalInterfacesBuilder_.getMessage(index); + } + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder setAdditionalInterfaces( + int index, io.a2a.grpc.AgentInterface value) { + if (additionalInterfacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.set(index, value); + onChanged(); + } else { + additionalInterfacesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder setAdditionalInterfaces( + int index, io.a2a.grpc.AgentInterface.Builder builderForValue) { + if (additionalInterfacesBuilder_ == null) { + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalInterfacesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder addAdditionalInterfaces(io.a2a.grpc.AgentInterface value) { + if (additionalInterfacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.add(value); + onChanged(); + } else { + additionalInterfacesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder addAdditionalInterfaces( + int index, io.a2a.grpc.AgentInterface value) { + if (additionalInterfacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.add(index, value); + onChanged(); + } else { + additionalInterfacesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder addAdditionalInterfaces( + io.a2a.grpc.AgentInterface.Builder builderForValue) { + if (additionalInterfacesBuilder_ == null) { + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.add(builderForValue.build()); + onChanged(); + } else { + additionalInterfacesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder addAdditionalInterfaces( + int index, io.a2a.grpc.AgentInterface.Builder builderForValue) { + if (additionalInterfacesBuilder_ == null) { + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalInterfacesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder addAllAdditionalInterfaces( + java.lang.Iterable values) { + if (additionalInterfacesBuilder_ == null) { + ensureAdditionalInterfacesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalInterfaces_); + onChanged(); + } else { + additionalInterfacesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder clearAdditionalInterfaces() { + if (additionalInterfacesBuilder_ == null) { + additionalInterfaces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + additionalInterfacesBuilder_.clear(); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public Builder removeAdditionalInterfaces(int index) { + if (additionalInterfacesBuilder_ == null) { + ensureAdditionalInterfacesIsMutable(); + additionalInterfaces_.remove(index); + onChanged(); + } else { + additionalInterfacesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public io.a2a.grpc.AgentInterface.Builder getAdditionalInterfacesBuilder( + int index) { + return internalGetAdditionalInterfacesFieldBuilder().getBuilder(index); + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public io.a2a.grpc.AgentInterfaceOrBuilder getAdditionalInterfacesOrBuilder( + int index) { + if (additionalInterfacesBuilder_ == null) { + return additionalInterfaces_.get(index); } else { + return additionalInterfacesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public java.util.List + getAdditionalInterfacesOrBuilderList() { + if (additionalInterfacesBuilder_ != null) { + return additionalInterfacesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalInterfaces_); + } + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public io.a2a.grpc.AgentInterface.Builder addAdditionalInterfacesBuilder() { + return internalGetAdditionalInterfacesFieldBuilder().addBuilder( + io.a2a.grpc.AgentInterface.getDefaultInstance()); + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public io.a2a.grpc.AgentInterface.Builder addAdditionalInterfacesBuilder( + int index) { + return internalGetAdditionalInterfacesFieldBuilder().addBuilder( + index, io.a2a.grpc.AgentInterface.getDefaultInstance()); + } + /** + *
+     * Announcement of additional supported transports. Client can use any of
+     * the supported transports.
+     * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + public java.util.List + getAdditionalInterfacesBuilderList() { + return internalGetAdditionalInterfacesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentInterface, io.a2a.grpc.AgentInterface.Builder, io.a2a.grpc.AgentInterfaceOrBuilder> + internalGetAdditionalInterfacesFieldBuilder() { + if (additionalInterfacesBuilder_ == null) { + additionalInterfacesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentInterface, io.a2a.grpc.AgentInterface.Builder, io.a2a.grpc.AgentInterfaceOrBuilder>( + additionalInterfaces_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + additionalInterfaces_ = null; + } + return additionalInterfacesBuilder_; + } + + private io.a2a.grpc.AgentProvider provider_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AgentProvider, io.a2a.grpc.AgentProvider.Builder, io.a2a.grpc.AgentProviderOrBuilder> providerBuilder_; + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + * @return Whether the provider field is set. + */ + public boolean hasProvider() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + * @return The provider. + */ + public io.a2a.grpc.AgentProvider getProvider() { + if (providerBuilder_ == null) { + return provider_ == null ? io.a2a.grpc.AgentProvider.getDefaultInstance() : provider_; + } else { + return providerBuilder_.getMessage(); + } + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + public Builder setProvider(io.a2a.grpc.AgentProvider value) { + if (providerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + provider_ = value; + } else { + providerBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + public Builder setProvider( + io.a2a.grpc.AgentProvider.Builder builderForValue) { + if (providerBuilder_ == null) { + provider_ = builderForValue.build(); + } else { + providerBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + public Builder mergeProvider(io.a2a.grpc.AgentProvider value) { + if (providerBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + provider_ != null && + provider_ != io.a2a.grpc.AgentProvider.getDefaultInstance()) { + getProviderBuilder().mergeFrom(value); + } else { + provider_ = value; + } + } else { + providerBuilder_.mergeFrom(value); + } + if (provider_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + public Builder clearProvider() { + bitField0_ = (bitField0_ & ~0x00000040); + provider_ = null; + if (providerBuilder_ != null) { + providerBuilder_.dispose(); + providerBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + public io.a2a.grpc.AgentProvider.Builder getProviderBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetProviderFieldBuilder().getBuilder(); + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + public io.a2a.grpc.AgentProviderOrBuilder getProviderOrBuilder() { + if (providerBuilder_ != null) { + return providerBuilder_.getMessageOrBuilder(); + } else { + return provider_ == null ? + io.a2a.grpc.AgentProvider.getDefaultInstance() : provider_; + } + } + /** + *
+     * The service provider of the agent.
+     * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AgentProvider, io.a2a.grpc.AgentProvider.Builder, io.a2a.grpc.AgentProviderOrBuilder> + internalGetProviderFieldBuilder() { + if (providerBuilder_ == null) { + providerBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AgentProvider, io.a2a.grpc.AgentProvider.Builder, io.a2a.grpc.AgentProviderOrBuilder>( + getProvider(), + getParentForChildren(), + isClean()); + provider_ = null; + } + return providerBuilder_; + } + + private java.lang.Object version_ = ""; + /** + *
+     * The version of the agent.
+     * Example: "1.0.0"
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The version of the agent.
+     * Example: "1.0.0"
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The version of the agent.
+     * Example: "1.0.0"
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + version_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+     * The version of the agent.
+     * Example: "1.0.0"
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @return This builder for chaining. + */ + public Builder clearVersion() { + version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + *
+     * The version of the agent.
+     * Example: "1.0.0"
+     * 
+ * + * string version = 5 [json_name = "version"]; + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + version_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object documentationUrl_ = ""; + /** + *
+     * A url to provide additional documentation about the agent.
+     * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return The documentationUrl. + */ + public java.lang.String getDocumentationUrl() { + java.lang.Object ref = documentationUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentationUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A url to provide additional documentation about the agent.
+     * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return The bytes for documentationUrl. + */ + public com.google.protobuf.ByteString + getDocumentationUrlBytes() { + java.lang.Object ref = documentationUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + documentationUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A url to provide additional documentation about the agent.
+     * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @param value The documentationUrl to set. + * @return This builder for chaining. + */ + public Builder setDocumentationUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + documentationUrl_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+     * A url to provide additional documentation about the agent.
+     * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return This builder for chaining. + */ + public Builder clearDocumentationUrl() { + documentationUrl_ = getDefaultInstance().getDocumentationUrl(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + *
+     * A url to provide additional documentation about the agent.
+     * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @param value The bytes for documentationUrl to set. + * @return This builder for chaining. + */ + public Builder setDocumentationUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + documentationUrl_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private io.a2a.grpc.AgentCapabilities capabilities_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AgentCapabilities, io.a2a.grpc.AgentCapabilities.Builder, io.a2a.grpc.AgentCapabilitiesOrBuilder> capabilitiesBuilder_; + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + * @return Whether the capabilities field is set. + */ + public boolean hasCapabilities() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + * @return The capabilities. + */ + public io.a2a.grpc.AgentCapabilities getCapabilities() { + if (capabilitiesBuilder_ == null) { + return capabilities_ == null ? io.a2a.grpc.AgentCapabilities.getDefaultInstance() : capabilities_; + } else { + return capabilitiesBuilder_.getMessage(); + } + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + public Builder setCapabilities(io.a2a.grpc.AgentCapabilities value) { + if (capabilitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + capabilities_ = value; + } else { + capabilitiesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + public Builder setCapabilities( + io.a2a.grpc.AgentCapabilities.Builder builderForValue) { + if (capabilitiesBuilder_ == null) { + capabilities_ = builderForValue.build(); + } else { + capabilitiesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + public Builder mergeCapabilities(io.a2a.grpc.AgentCapabilities value) { + if (capabilitiesBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + capabilities_ != null && + capabilities_ != io.a2a.grpc.AgentCapabilities.getDefaultInstance()) { + getCapabilitiesBuilder().mergeFrom(value); + } else { + capabilities_ = value; + } + } else { + capabilitiesBuilder_.mergeFrom(value); + } + if (capabilities_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + public Builder clearCapabilities() { + bitField0_ = (bitField0_ & ~0x00000200); + capabilities_ = null; + if (capabilitiesBuilder_ != null) { + capabilitiesBuilder_.dispose(); + capabilitiesBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + public io.a2a.grpc.AgentCapabilities.Builder getCapabilitiesBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetCapabilitiesFieldBuilder().getBuilder(); + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + public io.a2a.grpc.AgentCapabilitiesOrBuilder getCapabilitiesOrBuilder() { + if (capabilitiesBuilder_ != null) { + return capabilitiesBuilder_.getMessageOrBuilder(); + } else { + return capabilities_ == null ? + io.a2a.grpc.AgentCapabilities.getDefaultInstance() : capabilities_; + } + } + /** + *
+     * A2A Capability set supported by the agent.
+     * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AgentCapabilities, io.a2a.grpc.AgentCapabilities.Builder, io.a2a.grpc.AgentCapabilitiesOrBuilder> + internalGetCapabilitiesFieldBuilder() { + if (capabilitiesBuilder_ == null) { + capabilitiesBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AgentCapabilities, io.a2a.grpc.AgentCapabilities.Builder, io.a2a.grpc.AgentCapabilitiesOrBuilder>( + getCapabilities(), + getParentForChildren(), + isClean()); + capabilities_ = null; + } + return capabilitiesBuilder_; + } + + private static final class SecuritySchemesConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public io.a2a.grpc.SecurityScheme build(io.a2a.grpc.SecuritySchemeOrBuilder val) { + if (val instanceof io.a2a.grpc.SecurityScheme) { return (io.a2a.grpc.SecurityScheme) val; } + return ((io.a2a.grpc.SecurityScheme.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return SecuritySchemesDefaultEntryHolder.defaultEntry; + } + }; + private static final SecuritySchemesConverter securitySchemesConverter = new SecuritySchemesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, io.a2a.grpc.SecuritySchemeOrBuilder, io.a2a.grpc.SecurityScheme, io.a2a.grpc.SecurityScheme.Builder> securitySchemes_; + private com.google.protobuf.MapFieldBuilder + internalGetSecuritySchemes() { + if (securitySchemes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(securitySchemesConverter); + } + return securitySchemes_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableSecuritySchemes() { + if (securitySchemes_ == null) { + securitySchemes_ = new com.google.protobuf.MapFieldBuilder<>(securitySchemesConverter); + } + bitField0_ |= 0x00000400; + onChanged(); + return securitySchemes_; + } + public int getSecuritySchemesCount() { + return internalGetSecuritySchemes().ensureBuilderMap().size(); + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public boolean containsSecuritySchemes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSecuritySchemes().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getSecuritySchemesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSecuritySchemes() { + return getSecuritySchemesMap(); + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public java.util.Map getSecuritySchemesMap() { + return internalGetSecuritySchemes().getImmutableMap(); + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public /* nullable */ +io.a2a.grpc.SecurityScheme getSecuritySchemesOrDefault( + java.lang.String key, + /* nullable */ +io.a2a.grpc.SecurityScheme defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSecuritySchemes().ensureBuilderMap(); + return map.containsKey(key) ? securitySchemesConverter.build(map.get(key)) : defaultValue; + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + @java.lang.Override + public io.a2a.grpc.SecurityScheme getSecuritySchemesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSecuritySchemes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return securitySchemesConverter.build(map.get(key)); + } + public Builder clearSecuritySchemes() { + bitField0_ = (bitField0_ & ~0x00000400); + internalGetMutableSecuritySchemes().clear(); + return this; + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + public Builder removeSecuritySchemes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableSecuritySchemes().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableSecuritySchemes() { + bitField0_ |= 0x00000400; + return internalGetMutableSecuritySchemes().ensureMessageMap(); + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + public Builder putSecuritySchemes( + java.lang.String key, + io.a2a.grpc.SecurityScheme value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableSecuritySchemes().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000400; + return this; + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + public Builder putAllSecuritySchemes( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableSecuritySchemes().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000400; + return this; + } + /** + *
+     * The security scheme details used for authenticating with this agent.
+     * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + public io.a2a.grpc.SecurityScheme.Builder putSecuritySchemesBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableSecuritySchemes().ensureBuilderMap(); + io.a2a.grpc.SecuritySchemeOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = io.a2a.grpc.SecurityScheme.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof io.a2a.grpc.SecurityScheme) { + entry = ((io.a2a.grpc.SecurityScheme) entry).toBuilder(); + builderMap.put(key, entry); + } + return (io.a2a.grpc.SecurityScheme.Builder) entry; + } + + private java.util.List security_ = + java.util.Collections.emptyList(); + private void ensureSecurityIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + security_ = new java.util.ArrayList(security_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Security, io.a2a.grpc.Security.Builder, io.a2a.grpc.SecurityOrBuilder> securityBuilder_; + + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public java.util.List getSecurityList() { + if (securityBuilder_ == null) { + return java.util.Collections.unmodifiableList(security_); + } else { + return securityBuilder_.getMessageList(); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public int getSecurityCount() { + if (securityBuilder_ == null) { + return security_.size(); + } else { + return securityBuilder_.getCount(); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public io.a2a.grpc.Security getSecurity(int index) { + if (securityBuilder_ == null) { + return security_.get(index); + } else { + return securityBuilder_.getMessage(index); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder setSecurity( + int index, io.a2a.grpc.Security value) { + if (securityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecurityIsMutable(); + security_.set(index, value); + onChanged(); + } else { + securityBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder setSecurity( + int index, io.a2a.grpc.Security.Builder builderForValue) { + if (securityBuilder_ == null) { + ensureSecurityIsMutable(); + security_.set(index, builderForValue.build()); + onChanged(); + } else { + securityBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder addSecurity(io.a2a.grpc.Security value) { + if (securityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecurityIsMutable(); + security_.add(value); + onChanged(); + } else { + securityBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder addSecurity( + int index, io.a2a.grpc.Security value) { + if (securityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecurityIsMutable(); + security_.add(index, value); + onChanged(); + } else { + securityBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder addSecurity( + io.a2a.grpc.Security.Builder builderForValue) { + if (securityBuilder_ == null) { + ensureSecurityIsMutable(); + security_.add(builderForValue.build()); + onChanged(); + } else { + securityBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder addSecurity( + int index, io.a2a.grpc.Security.Builder builderForValue) { + if (securityBuilder_ == null) { + ensureSecurityIsMutable(); + security_.add(index, builderForValue.build()); + onChanged(); + } else { + securityBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder addAllSecurity( + java.lang.Iterable values) { + if (securityBuilder_ == null) { + ensureSecurityIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, security_); + onChanged(); + } else { + securityBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder clearSecurity() { + if (securityBuilder_ == null) { + security_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + securityBuilder_.clear(); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public Builder removeSecurity(int index) { + if (securityBuilder_ == null) { + ensureSecurityIsMutable(); + security_.remove(index); + onChanged(); + } else { + securityBuilder_.remove(index); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public io.a2a.grpc.Security.Builder getSecurityBuilder( + int index) { + return internalGetSecurityFieldBuilder().getBuilder(index); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public io.a2a.grpc.SecurityOrBuilder getSecurityOrBuilder( + int index) { + if (securityBuilder_ == null) { + return security_.get(index); } else { + return securityBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public java.util.List + getSecurityOrBuilderList() { + if (securityBuilder_ != null) { + return securityBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(security_); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public io.a2a.grpc.Security.Builder addSecurityBuilder() { + return internalGetSecurityFieldBuilder().addBuilder( + io.a2a.grpc.Security.getDefaultInstance()); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public io.a2a.grpc.Security.Builder addSecurityBuilder( + int index) { + return internalGetSecurityFieldBuilder().addBuilder( + index, io.a2a.grpc.Security.getDefaultInstance()); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Security requirements for contacting the agent.
+     * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + public java.util.List + getSecurityBuilderList() { + return internalGetSecurityFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Security, io.a2a.grpc.Security.Builder, io.a2a.grpc.SecurityOrBuilder> + internalGetSecurityFieldBuilder() { + if (securityBuilder_ == null) { + securityBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Security, io.a2a.grpc.Security.Builder, io.a2a.grpc.SecurityOrBuilder>( + security_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + security_ = null; + } + return securityBuilder_; + } + + private com.google.protobuf.LazyStringArrayList defaultInputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureDefaultInputModesIsMutable() { + if (!defaultInputModes_.isModifiable()) { + defaultInputModes_ = new com.google.protobuf.LazyStringArrayList(defaultInputModes_); + } + bitField0_ |= 0x00001000; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return A list containing the defaultInputModes. + */ + public com.google.protobuf.ProtocolStringList + getDefaultInputModesList() { + defaultInputModes_.makeImmutable(); + return defaultInputModes_; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return The count of defaultInputModes. + */ + public int getDefaultInputModesCount() { + return defaultInputModes_.size(); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index of the element to return. + * @return The defaultInputModes at the given index. + */ + public java.lang.String getDefaultInputModes(int index) { + return defaultInputModes_.get(index); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index of the value to return. + * @return The bytes of the defaultInputModes at the given index. + */ + public com.google.protobuf.ByteString + getDefaultInputModesBytes(int index) { + return defaultInputModes_.getByteString(index); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index to set the value at. + * @param value The defaultInputModes to set. + * @return This builder for chaining. + */ + public Builder setDefaultInputModes( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDefaultInputModesIsMutable(); + defaultInputModes_.set(index, value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param value The defaultInputModes to add. + * @return This builder for chaining. + */ + public Builder addDefaultInputModes( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDefaultInputModesIsMutable(); + defaultInputModes_.add(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param values The defaultInputModes to add. + * @return This builder for chaining. + */ + public Builder addAllDefaultInputModes( + java.lang.Iterable values) { + ensureDefaultInputModesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, defaultInputModes_); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return This builder for chaining. + */ + public Builder clearDefaultInputModes() { + defaultInputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000);; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * The set of interaction modes that the agent supports across all skills.
+     * This can be overridden per skill. Defined as mime types.
+     * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param value The bytes of the defaultInputModes to add. + * @return This builder for chaining. + */ + public Builder addDefaultInputModesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureDefaultInputModesIsMutable(); + defaultInputModes_.add(value); + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList defaultOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureDefaultOutputModesIsMutable() { + if (!defaultOutputModes_.isModifiable()) { + defaultOutputModes_ = new com.google.protobuf.LazyStringArrayList(defaultOutputModes_); + } + bitField0_ |= 0x00002000; + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return A list containing the defaultOutputModes. + */ + public com.google.protobuf.ProtocolStringList + getDefaultOutputModesList() { + defaultOutputModes_.makeImmutable(); + return defaultOutputModes_; + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return The count of defaultOutputModes. + */ + public int getDefaultOutputModesCount() { + return defaultOutputModes_.size(); + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index of the element to return. + * @return The defaultOutputModes at the given index. + */ + public java.lang.String getDefaultOutputModes(int index) { + return defaultOutputModes_.get(index); + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index of the value to return. + * @return The bytes of the defaultOutputModes at the given index. + */ + public com.google.protobuf.ByteString + getDefaultOutputModesBytes(int index) { + return defaultOutputModes_.getByteString(index); + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index to set the value at. + * @param value The defaultOutputModes to set. + * @return This builder for chaining. + */ + public Builder setDefaultOutputModes( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDefaultOutputModesIsMutable(); + defaultOutputModes_.set(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param value The defaultOutputModes to add. + * @return This builder for chaining. + */ + public Builder addDefaultOutputModes( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureDefaultOutputModesIsMutable(); + defaultOutputModes_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param values The defaultOutputModes to add. + * @return This builder for chaining. + */ + public Builder addAllDefaultOutputModes( + java.lang.Iterable values) { + ensureDefaultOutputModesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, defaultOutputModes_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return This builder for chaining. + */ + public Builder clearDefaultOutputModes() { + defaultOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000);; + onChanged(); + return this; + } + /** + *
+     * The mime types supported as outputs from this agent.
+     * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param value The bytes of the defaultOutputModes to add. + * @return This builder for chaining. + */ + public Builder addDefaultOutputModesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureDefaultOutputModesIsMutable(); + defaultOutputModes_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private java.util.List skills_ = + java.util.Collections.emptyList(); + private void ensureSkillsIsMutable() { + if (!((bitField0_ & 0x00004000) != 0)) { + skills_ = new java.util.ArrayList(skills_); + bitField0_ |= 0x00004000; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentSkill, io.a2a.grpc.AgentSkill.Builder, io.a2a.grpc.AgentSkillOrBuilder> skillsBuilder_; + + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public java.util.List getSkillsList() { + if (skillsBuilder_ == null) { + return java.util.Collections.unmodifiableList(skills_); + } else { + return skillsBuilder_.getMessageList(); + } + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public int getSkillsCount() { + if (skillsBuilder_ == null) { + return skills_.size(); + } else { + return skillsBuilder_.getCount(); + } + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public io.a2a.grpc.AgentSkill getSkills(int index) { + if (skillsBuilder_ == null) { + return skills_.get(index); + } else { + return skillsBuilder_.getMessage(index); + } + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder setSkills( + int index, io.a2a.grpc.AgentSkill value) { + if (skillsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkillsIsMutable(); + skills_.set(index, value); + onChanged(); + } else { + skillsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder setSkills( + int index, io.a2a.grpc.AgentSkill.Builder builderForValue) { + if (skillsBuilder_ == null) { + ensureSkillsIsMutable(); + skills_.set(index, builderForValue.build()); + onChanged(); + } else { + skillsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder addSkills(io.a2a.grpc.AgentSkill value) { + if (skillsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkillsIsMutable(); + skills_.add(value); + onChanged(); + } else { + skillsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder addSkills( + int index, io.a2a.grpc.AgentSkill value) { + if (skillsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkillsIsMutable(); + skills_.add(index, value); + onChanged(); + } else { + skillsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder addSkills( + io.a2a.grpc.AgentSkill.Builder builderForValue) { + if (skillsBuilder_ == null) { + ensureSkillsIsMutable(); + skills_.add(builderForValue.build()); + onChanged(); + } else { + skillsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder addSkills( + int index, io.a2a.grpc.AgentSkill.Builder builderForValue) { + if (skillsBuilder_ == null) { + ensureSkillsIsMutable(); + skills_.add(index, builderForValue.build()); + onChanged(); + } else { + skillsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder addAllSkills( + java.lang.Iterable values) { + if (skillsBuilder_ == null) { + ensureSkillsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, skills_); + onChanged(); + } else { + skillsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder clearSkills() { + if (skillsBuilder_ == null) { + skills_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + } else { + skillsBuilder_.clear(); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public Builder removeSkills(int index) { + if (skillsBuilder_ == null) { + ensureSkillsIsMutable(); + skills_.remove(index); + onChanged(); + } else { + skillsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public io.a2a.grpc.AgentSkill.Builder getSkillsBuilder( + int index) { + return internalGetSkillsFieldBuilder().getBuilder(index); + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public io.a2a.grpc.AgentSkillOrBuilder getSkillsOrBuilder( + int index) { + if (skillsBuilder_ == null) { + return skills_.get(index); } else { + return skillsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public java.util.List + getSkillsOrBuilderList() { + if (skillsBuilder_ != null) { + return skillsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(skills_); + } + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public io.a2a.grpc.AgentSkill.Builder addSkillsBuilder() { + return internalGetSkillsFieldBuilder().addBuilder( + io.a2a.grpc.AgentSkill.getDefaultInstance()); + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public io.a2a.grpc.AgentSkill.Builder addSkillsBuilder( + int index) { + return internalGetSkillsFieldBuilder().addBuilder( + index, io.a2a.grpc.AgentSkill.getDefaultInstance()); + } + /** + *
+     * Skills represent a unit of ability an agent can perform. This may
+     * somewhat abstract but represents a more focused set of actions that the
+     * agent is highly likely to succeed at.
+     * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + public java.util.List + getSkillsBuilderList() { + return internalGetSkillsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentSkill, io.a2a.grpc.AgentSkill.Builder, io.a2a.grpc.AgentSkillOrBuilder> + internalGetSkillsFieldBuilder() { + if (skillsBuilder_ == null) { + skillsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.AgentSkill, io.a2a.grpc.AgentSkill.Builder, io.a2a.grpc.AgentSkillOrBuilder>( + skills_, + ((bitField0_ & 0x00004000) != 0), + getParentForChildren(), + isClean()); + skills_ = null; + } + return skillsBuilder_; + } + + private boolean supportsAuthenticatedExtendedCard_ ; + /** + *
+     * Whether the agent supports providing an extended agent card when
+     * the user is authenticated, i.e. is the card from .well-known
+     * different than the card from GetAgentCard.
+     * 
+ * + * bool supports_authenticated_extended_card = 13 [json_name = "supportsAuthenticatedExtendedCard"]; + * @return The supportsAuthenticatedExtendedCard. + */ + @java.lang.Override + public boolean getSupportsAuthenticatedExtendedCard() { + return supportsAuthenticatedExtendedCard_; + } + /** + *
+     * Whether the agent supports providing an extended agent card when
+     * the user is authenticated, i.e. is the card from .well-known
+     * different than the card from GetAgentCard.
+     * 
+ * + * bool supports_authenticated_extended_card = 13 [json_name = "supportsAuthenticatedExtendedCard"]; + * @param value The supportsAuthenticatedExtendedCard to set. + * @return This builder for chaining. + */ + public Builder setSupportsAuthenticatedExtendedCard(boolean value) { + + supportsAuthenticatedExtendedCard_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + *
+     * Whether the agent supports providing an extended agent card when
+     * the user is authenticated, i.e. is the card from .well-known
+     * different than the card from GetAgentCard.
+     * 
+ * + * bool supports_authenticated_extended_card = 13 [json_name = "supportsAuthenticatedExtendedCard"]; + * @return This builder for chaining. + */ + public Builder clearSupportsAuthenticatedExtendedCard() { + bitField0_ = (bitField0_ & ~0x00008000); + supportsAuthenticatedExtendedCard_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AgentCard) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AgentCard) + private static final io.a2a.grpc.AgentCard DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AgentCard(); + } + + public static io.a2a.grpc.AgentCard getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AgentCard 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 io.a2a.grpc.AgentCard getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AgentCardOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AgentCardOrBuilder.java new file mode 100644 index 000000000..4de7e064d --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentCardOrBuilder.java @@ -0,0 +1,522 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AgentCardOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AgentCard) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The version of the A2A protocol this agent supports.
+   * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return The protocolVersion. + */ + java.lang.String getProtocolVersion(); + /** + *
+   * The version of the A2A protocol this agent supports.
+   * 
+ * + * string protocol_version = 16 [json_name = "protocolVersion"]; + * @return The bytes for protocolVersion. + */ + com.google.protobuf.ByteString + getProtocolVersionBytes(); + + /** + *
+   * A human readable name for the agent.
+   * Example: "Recipe Agent"
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * A human readable name for the agent.
+   * Example: "Recipe Agent"
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A description of the agent's domain of action/solution space.
+   * Example: "Agent that helps users with recipes and cooking."
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * A description of the agent's domain of action/solution space.
+   * Example: "Agent that helps users with recipes and cooking."
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * A URL to the address the agent is hosted at. This represents the
+   * preferred endpoint as declared by the agent.
+   * 
+ * + * string url = 3 [json_name = "url"]; + * @return The url. + */ + java.lang.String getUrl(); + /** + *
+   * A URL to the address the agent is hosted at. This represents the
+   * preferred endpoint as declared by the agent.
+   * 
+ * + * string url = 3 [json_name = "url"]; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+   * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return The preferredTransport. + */ + java.lang.String getPreferredTransport(); + /** + *
+   * The transport of the preferred endpoint. If empty, defaults to JSONRPC.
+   * 
+ * + * string preferred_transport = 14 [json_name = "preferredTransport"]; + * @return The bytes for preferredTransport. + */ + com.google.protobuf.ByteString + getPreferredTransportBytes(); + + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + java.util.List + getAdditionalInterfacesList(); + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + io.a2a.grpc.AgentInterface getAdditionalInterfaces(int index); + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + int getAdditionalInterfacesCount(); + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + java.util.List + getAdditionalInterfacesOrBuilderList(); + /** + *
+   * Announcement of additional supported transports. Client can use any of
+   * the supported transports.
+   * 
+ * + * repeated .a2a.v1.AgentInterface additional_interfaces = 15 [json_name = "additionalInterfaces"]; + */ + io.a2a.grpc.AgentInterfaceOrBuilder getAdditionalInterfacesOrBuilder( + int index); + + /** + *
+   * The service provider of the agent.
+   * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + * @return Whether the provider field is set. + */ + boolean hasProvider(); + /** + *
+   * The service provider of the agent.
+   * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + * @return The provider. + */ + io.a2a.grpc.AgentProvider getProvider(); + /** + *
+   * The service provider of the agent.
+   * 
+ * + * .a2a.v1.AgentProvider provider = 4 [json_name = "provider"]; + */ + io.a2a.grpc.AgentProviderOrBuilder getProviderOrBuilder(); + + /** + *
+   * The version of the agent.
+   * Example: "1.0.0"
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The version. + */ + java.lang.String getVersion(); + /** + *
+   * The version of the agent.
+   * Example: "1.0.0"
+   * 
+ * + * string version = 5 [json_name = "version"]; + * @return The bytes for version. + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + *
+   * A url to provide additional documentation about the agent.
+   * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return The documentationUrl. + */ + java.lang.String getDocumentationUrl(); + /** + *
+   * A url to provide additional documentation about the agent.
+   * 
+ * + * string documentation_url = 6 [json_name = "documentationUrl"]; + * @return The bytes for documentationUrl. + */ + com.google.protobuf.ByteString + getDocumentationUrlBytes(); + + /** + *
+   * A2A Capability set supported by the agent.
+   * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + * @return Whether the capabilities field is set. + */ + boolean hasCapabilities(); + /** + *
+   * A2A Capability set supported by the agent.
+   * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + * @return The capabilities. + */ + io.a2a.grpc.AgentCapabilities getCapabilities(); + /** + *
+   * A2A Capability set supported by the agent.
+   * 
+ * + * .a2a.v1.AgentCapabilities capabilities = 7 [json_name = "capabilities"]; + */ + io.a2a.grpc.AgentCapabilitiesOrBuilder getCapabilitiesOrBuilder(); + + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + int getSecuritySchemesCount(); + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + boolean containsSecuritySchemes( + java.lang.String key); + /** + * Use {@link #getSecuritySchemesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSecuritySchemes(); + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + java.util.Map + getSecuritySchemesMap(); + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + /* nullable */ +io.a2a.grpc.SecurityScheme getSecuritySchemesOrDefault( + java.lang.String key, + /* nullable */ +io.a2a.grpc.SecurityScheme defaultValue); + /** + *
+   * The security scheme details used for authenticating with this agent.
+   * 
+ * + * map<string, .a2a.v1.SecurityScheme> security_schemes = 8 [json_name = "securitySchemes"]; + */ + io.a2a.grpc.SecurityScheme getSecuritySchemesOrThrow( + java.lang.String key); + + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + java.util.List + getSecurityList(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + io.a2a.grpc.Security getSecurity(int index); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + int getSecurityCount(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + java.util.List + getSecurityOrBuilderList(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Security requirements for contacting the agent.
+   * 
+ * + * repeated .a2a.v1.Security security = 9 [json_name = "security"]; + */ + io.a2a.grpc.SecurityOrBuilder getSecurityOrBuilder( + int index); + + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return A list containing the defaultInputModes. + */ + java.util.List + getDefaultInputModesList(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @return The count of defaultInputModes. + */ + int getDefaultInputModesCount(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index of the element to return. + * @return The defaultInputModes at the given index. + */ + java.lang.String getDefaultInputModes(int index); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * The set of interaction modes that the agent supports across all skills.
+   * This can be overridden per skill. Defined as mime types.
+   * 
+ * + * repeated string default_input_modes = 10 [json_name = "defaultInputModes"]; + * @param index The index of the value to return. + * @return The bytes of the defaultInputModes at the given index. + */ + com.google.protobuf.ByteString + getDefaultInputModesBytes(int index); + + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return A list containing the defaultOutputModes. + */ + java.util.List + getDefaultOutputModesList(); + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @return The count of defaultOutputModes. + */ + int getDefaultOutputModesCount(); + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index of the element to return. + * @return The defaultOutputModes at the given index. + */ + java.lang.String getDefaultOutputModes(int index); + /** + *
+   * The mime types supported as outputs from this agent.
+   * 
+ * + * repeated string default_output_modes = 11 [json_name = "defaultOutputModes"]; + * @param index The index of the value to return. + * @return The bytes of the defaultOutputModes at the given index. + */ + com.google.protobuf.ByteString + getDefaultOutputModesBytes(int index); + + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + java.util.List + getSkillsList(); + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + io.a2a.grpc.AgentSkill getSkills(int index); + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + int getSkillsCount(); + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + java.util.List + getSkillsOrBuilderList(); + /** + *
+   * Skills represent a unit of ability an agent can perform. This may
+   * somewhat abstract but represents a more focused set of actions that the
+   * agent is highly likely to succeed at.
+   * 
+ * + * repeated .a2a.v1.AgentSkill skills = 12 [json_name = "skills"]; + */ + io.a2a.grpc.AgentSkillOrBuilder getSkillsOrBuilder( + int index); + + /** + *
+   * Whether the agent supports providing an extended agent card when
+   * the user is authenticated, i.e. is the card from .well-known
+   * different than the card from GetAgentCard.
+   * 
+ * + * bool supports_authenticated_extended_card = 13 [json_name = "supportsAuthenticatedExtendedCard"]; + * @return The supportsAuthenticatedExtendedCard. + */ + boolean getSupportsAuthenticatedExtendedCard(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AgentExtension.java b/grpc/src/main/java/io/a2a/grpc/AgentExtension.java new file mode 100644 index 000000000..04e298d8d --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentExtension.java @@ -0,0 +1,1044 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * A declaration of an extension supported by an Agent.
+ * 
+ * + * Protobuf type {@code a2a.v1.AgentExtension} + */ +@com.google.protobuf.Generated +public final class AgentExtension extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AgentExtension) + AgentExtensionOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AgentExtension.class.getName()); + } + // Use AgentExtension.newBuilder() to construct. + private AgentExtension(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AgentExtension() { + uri_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentExtension_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentExtension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentExtension.class, io.a2a.grpc.AgentExtension.Builder.class); + } + + private int bitField0_; + public static final int URI_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object uri_ = ""; + /** + *
+   * The URI of the extension.
+   * Example: "https://developers.google.com/identity/protocols/oauth2"
+   * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + *
+   * The URI of the extension.
+   * Example: "https://developers.google.com/identity/protocols/oauth2"
+   * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * A description of how this agent uses this extension.
+   * Example: "Google OAuth 2.0 authentication"
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of how this agent uses this extension.
+   * Example: "Google OAuth 2.0 authentication"
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @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 REQUIRED_FIELD_NUMBER = 3; + private boolean required_ = false; + /** + *
+   * Whether the client must follow specific requirements of the extension.
+   * Example: false
+   * 
+ * + * bool required = 3 [json_name = "required"]; + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + + public static final int PARAMS_FIELD_NUMBER = 4; + private com.google.protobuf.Struct params_; + /** + *
+   * Optional configuration for the extension.
+   * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + * @return Whether the params field is set. + */ + @java.lang.Override + public boolean hasParams() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * Optional configuration for the extension.
+   * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + * @return The params. + */ + @java.lang.Override + public com.google.protobuf.Struct getParams() { + return params_ == null ? com.google.protobuf.Struct.getDefaultInstance() : params_; + } + /** + *
+   * Optional configuration for the extension.
+   * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getParamsOrBuilder() { + return params_ == null ? com.google.protobuf.Struct.getDefaultInstance() : params_; + } + + 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.GeneratedMessage.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, uri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (required_ != false) { + output.writeBool(3, required_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getParams()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, uri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (required_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, required_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getParams()); + } + 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 io.a2a.grpc.AgentExtension)) { + return super.equals(obj); + } + io.a2a.grpc.AgentExtension other = (io.a2a.grpc.AgentExtension) obj; + + if (!getUri() + .equals(other.getUri())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (getRequired() + != other.getRequired()) return false; + if (hasParams() != other.hasParams()) return false; + if (hasParams()) { + if (!getParams() + .equals(other.getParams())) 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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getRequired()); + if (hasParams()) { + hash = (37 * hash) + PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getParams().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AgentExtension parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentExtension parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentExtension parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentExtension parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentExtension parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentExtension parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentExtension parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentExtension parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AgentExtension parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AgentExtension parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AgentExtension parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentExtension parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AgentExtension 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A declaration of an extension supported by an Agent.
+   * 
+ * + * Protobuf type {@code a2a.v1.AgentExtension} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AgentExtension) + io.a2a.grpc.AgentExtensionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentExtension_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentExtension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentExtension.class, io.a2a.grpc.AgentExtension.Builder.class); + } + + // Construct using io.a2a.grpc.AgentExtension.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetParamsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uri_ = ""; + description_ = ""; + required_ = false; + params_ = null; + if (paramsBuilder_ != null) { + paramsBuilder_.dispose(); + paramsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentExtension_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AgentExtension getDefaultInstanceForType() { + return io.a2a.grpc.AgentExtension.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AgentExtension build() { + io.a2a.grpc.AgentExtension result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AgentExtension buildPartial() { + io.a2a.grpc.AgentExtension result = new io.a2a.grpc.AgentExtension(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.AgentExtension result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uri_ = uri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.required_ = required_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.params_ = paramsBuilder_ == null + ? params_ + : paramsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AgentExtension) { + return mergeFrom((io.a2a.grpc.AgentExtension)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AgentExtension other) { + if (other == io.a2a.grpc.AgentExtension.getDefaultInstance()) return this; + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getRequired() != false) { + setRequired(other.getRequired()); + } + if (other.hasParams()) { + mergeParams(other.getParams()); + } + 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: { + uri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + required_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: { + input.readMessage( + internalGetParamsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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 uri_ = ""; + /** + *
+     * The URI of the extension.
+     * Example: "https://developers.google.com/identity/protocols/oauth2"
+     * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URI of the extension.
+     * Example: "https://developers.google.com/identity/protocols/oauth2"
+     * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URI of the extension.
+     * Example: "https://developers.google.com/identity/protocols/oauth2"
+     * 
+ * + * string uri = 1 [json_name = "uri"]; + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The URI of the extension.
+     * Example: "https://developers.google.com/identity/protocols/oauth2"
+     * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return This builder for chaining. + */ + public Builder clearUri() { + uri_ = getDefaultInstance().getUri(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The URI of the extension.
+     * Example: "https://developers.google.com/identity/protocols/oauth2"
+     * 
+ * + * string uri = 1 [json_name = "uri"]; + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + uri_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * A description of how this agent uses this extension.
+     * Example: "Google OAuth 2.0 authentication"
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of how this agent uses this extension.
+     * Example: "Google OAuth 2.0 authentication"
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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 description of how this agent uses this extension.
+     * Example: "Google OAuth 2.0 authentication"
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A description of how this agent uses this extension.
+     * Example: "Google OAuth 2.0 authentication"
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A description of how this agent uses this extension.
+     * Example: "Google OAuth 2.0 authentication"
+     * 
+ * + * string description = 2 [json_name = "description"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean required_ ; + /** + *
+     * Whether the client must follow specific requirements of the extension.
+     * Example: false
+     * 
+ * + * bool required = 3 [json_name = "required"]; + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + /** + *
+     * Whether the client must follow specific requirements of the extension.
+     * Example: false
+     * 
+ * + * bool required = 3 [json_name = "required"]; + * @param value The required to set. + * @return This builder for chaining. + */ + public Builder setRequired(boolean value) { + + required_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Whether the client must follow specific requirements of the extension.
+     * Example: false
+     * 
+ * + * bool required = 3 [json_name = "required"]; + * @return This builder for chaining. + */ + public Builder clearRequired() { + bitField0_ = (bitField0_ & ~0x00000004); + required_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Struct params_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> paramsBuilder_; + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + * @return Whether the params field is set. + */ + public boolean hasParams() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + * @return The params. + */ + public com.google.protobuf.Struct getParams() { + if (paramsBuilder_ == null) { + return params_ == null ? com.google.protobuf.Struct.getDefaultInstance() : params_; + } else { + return paramsBuilder_.getMessage(); + } + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + public Builder setParams(com.google.protobuf.Struct value) { + if (paramsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + params_ = value; + } else { + paramsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + public Builder setParams( + com.google.protobuf.Struct.Builder builderForValue) { + if (paramsBuilder_ == null) { + params_ = builderForValue.build(); + } else { + paramsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + public Builder mergeParams(com.google.protobuf.Struct value) { + if (paramsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + params_ != null && + params_ != com.google.protobuf.Struct.getDefaultInstance()) { + getParamsBuilder().mergeFrom(value); + } else { + params_ = value; + } + } else { + paramsBuilder_.mergeFrom(value); + } + if (params_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + public Builder clearParams() { + bitField0_ = (bitField0_ & ~0x00000008); + params_ = null; + if (paramsBuilder_ != null) { + paramsBuilder_.dispose(); + paramsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + public com.google.protobuf.Struct.Builder getParamsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetParamsFieldBuilder().getBuilder(); + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + public com.google.protobuf.StructOrBuilder getParamsOrBuilder() { + if (paramsBuilder_ != null) { + return paramsBuilder_.getMessageOrBuilder(); + } else { + return params_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : params_; + } + } + /** + *
+     * Optional configuration for the extension.
+     * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetParamsFieldBuilder() { + if (paramsBuilder_ == null) { + paramsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getParams(), + getParentForChildren(), + isClean()); + params_ = null; + } + return paramsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AgentExtension) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AgentExtension) + private static final io.a2a.grpc.AgentExtension DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AgentExtension(); + } + + public static io.a2a.grpc.AgentExtension getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AgentExtension 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 io.a2a.grpc.AgentExtension getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AgentExtensionOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AgentExtensionOrBuilder.java new file mode 100644 index 000000000..580b65020 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentExtensionOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AgentExtensionOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AgentExtension) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The URI of the extension.
+   * Example: "https://developers.google.com/identity/protocols/oauth2"
+   * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return The uri. + */ + java.lang.String getUri(); + /** + *
+   * The URI of the extension.
+   * Example: "https://developers.google.com/identity/protocols/oauth2"
+   * 
+ * + * string uri = 1 [json_name = "uri"]; + * @return The bytes for uri. + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + *
+   * A description of how this agent uses this extension.
+   * Example: "Google OAuth 2.0 authentication"
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * A description of how this agent uses this extension.
+   * Example: "Google OAuth 2.0 authentication"
+   * 
+ * + * string description = 2 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Whether the client must follow specific requirements of the extension.
+   * Example: false
+   * 
+ * + * bool required = 3 [json_name = "required"]; + * @return The required. + */ + boolean getRequired(); + + /** + *
+   * Optional configuration for the extension.
+   * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + * @return Whether the params field is set. + */ + boolean hasParams(); + /** + *
+   * Optional configuration for the extension.
+   * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + * @return The params. + */ + com.google.protobuf.Struct getParams(); + /** + *
+   * Optional configuration for the extension.
+   * 
+ * + * .google.protobuf.Struct params = 4 [json_name = "params"]; + */ + com.google.protobuf.StructOrBuilder getParamsOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AgentInterface.java b/grpc/src/main/java/io/a2a/grpc/AgentInterface.java new file mode 100644 index 000000000..78ad52d8e --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentInterface.java @@ -0,0 +1,716 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Defines additional transport information for the agent.
+ * 
+ * + * Protobuf type {@code a2a.v1.AgentInterface} + */ +@com.google.protobuf.Generated +public final class AgentInterface extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AgentInterface) + AgentInterfaceOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AgentInterface.class.getName()); + } + // Use AgentInterface.newBuilder() to construct. + private AgentInterface(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AgentInterface() { + url_ = ""; + transport_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentInterface_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentInterface_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentInterface.class, io.a2a.grpc.AgentInterface.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + *
+   * The url this interface is found at.
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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(); + url_ = s; + return s; + } + } + /** + *
+   * The url this interface is found at.
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRANSPORT_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object transport_ = ""; + /** + *
+   * The transport supported this url. This is an open form string, to be
+   * easily extended for many transport protocols. The core ones officially
+   * supported are JSONRPC, GRPC and HTTP+JSON.
+   * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return The transport. + */ + @java.lang.Override + public java.lang.String getTransport() { + java.lang.Object ref = transport_; + 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(); + transport_ = s; + return s; + } + } + /** + *
+   * The transport supported this url. This is an open form string, to be
+   * easily extended for many transport protocols. The core ones officially
+   * supported are JSONRPC, GRPC and HTTP+JSON.
+   * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return The bytes for transport. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTransportBytes() { + java.lang.Object ref = transport_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transport_ = 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.GeneratedMessage.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, url_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(transport_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, transport_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, url_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(transport_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, transport_); + } + 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 io.a2a.grpc.AgentInterface)) { + return super.equals(obj); + } + io.a2a.grpc.AgentInterface other = (io.a2a.grpc.AgentInterface) obj; + + if (!getUrl() + .equals(other.getUrl())) return false; + if (!getTransport() + .equals(other.getTransport())) 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) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + TRANSPORT_FIELD_NUMBER; + hash = (53 * hash) + getTransport().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AgentInterface parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentInterface parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentInterface parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentInterface parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentInterface parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentInterface parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentInterface parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentInterface parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AgentInterface parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AgentInterface parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AgentInterface parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentInterface parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AgentInterface 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Defines additional transport information for the agent.
+   * 
+ * + * Protobuf type {@code a2a.v1.AgentInterface} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AgentInterface) + io.a2a.grpc.AgentInterfaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentInterface_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentInterface_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentInterface.class, io.a2a.grpc.AgentInterface.Builder.class); + } + + // Construct using io.a2a.grpc.AgentInterface.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + url_ = ""; + transport_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentInterface_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AgentInterface getDefaultInstanceForType() { + return io.a2a.grpc.AgentInterface.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AgentInterface build() { + io.a2a.grpc.AgentInterface result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AgentInterface buildPartial() { + io.a2a.grpc.AgentInterface result = new io.a2a.grpc.AgentInterface(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.AgentInterface result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.url_ = url_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.transport_ = transport_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AgentInterface) { + return mergeFrom((io.a2a.grpc.AgentInterface)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AgentInterface other) { + if (other == io.a2a.grpc.AgentInterface.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTransport().isEmpty()) { + transport_ = other.transport_; + bitField0_ |= 0x00000002; + 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: { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + transport_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 url_ = ""; + /** + *
+     * The url this interface is found at.
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The url this interface is found at.
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The url this interface is found at.
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + url_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The url this interface is found at.
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The url this interface is found at.
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object transport_ = ""; + /** + *
+     * The transport supported this url. This is an open form string, to be
+     * easily extended for many transport protocols. The core ones officially
+     * supported are JSONRPC, GRPC and HTTP+JSON.
+     * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return The transport. + */ + public java.lang.String getTransport() { + java.lang.Object ref = transport_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transport_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The transport supported this url. This is an open form string, to be
+     * easily extended for many transport protocols. The core ones officially
+     * supported are JSONRPC, GRPC and HTTP+JSON.
+     * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return The bytes for transport. + */ + public com.google.protobuf.ByteString + getTransportBytes() { + java.lang.Object ref = transport_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transport_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The transport supported this url. This is an open form string, to be
+     * easily extended for many transport protocols. The core ones officially
+     * supported are JSONRPC, GRPC and HTTP+JSON.
+     * 
+ * + * string transport = 2 [json_name = "transport"]; + * @param value The transport to set. + * @return This builder for chaining. + */ + public Builder setTransport( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + transport_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The transport supported this url. This is an open form string, to be
+     * easily extended for many transport protocols. The core ones officially
+     * supported are JSONRPC, GRPC and HTTP+JSON.
+     * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return This builder for chaining. + */ + public Builder clearTransport() { + transport_ = getDefaultInstance().getTransport(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The transport supported this url. This is an open form string, to be
+     * easily extended for many transport protocols. The core ones officially
+     * supported are JSONRPC, GRPC and HTTP+JSON.
+     * 
+ * + * string transport = 2 [json_name = "transport"]; + * @param value The bytes for transport to set. + * @return This builder for chaining. + */ + public Builder setTransportBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + transport_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AgentInterface) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AgentInterface) + private static final io.a2a.grpc.AgentInterface DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AgentInterface(); + } + + public static io.a2a.grpc.AgentInterface getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AgentInterface 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 io.a2a.grpc.AgentInterface getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AgentInterfaceOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AgentInterfaceOrBuilder.java new file mode 100644 index 000000000..22d5faf01 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentInterfaceOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AgentInterfaceOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AgentInterface) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The url this interface is found at.
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The url. + */ + java.lang.String getUrl(); + /** + *
+   * The url this interface is found at.
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * The transport supported this url. This is an open form string, to be
+   * easily extended for many transport protocols. The core ones officially
+   * supported are JSONRPC, GRPC and HTTP+JSON.
+   * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return The transport. + */ + java.lang.String getTransport(); + /** + *
+   * The transport supported this url. This is an open form string, to be
+   * easily extended for many transport protocols. The core ones officially
+   * supported are JSONRPC, GRPC and HTTP+JSON.
+   * 
+ * + * string transport = 2 [json_name = "transport"]; + * @return The bytes for transport. + */ + com.google.protobuf.ByteString + getTransportBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AgentProvider.java b/grpc/src/main/java/io/a2a/grpc/AgentProvider.java new file mode 100644 index 000000000..a166ddaa4 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentProvider.java @@ -0,0 +1,716 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Represents information about the service provider of an agent.
+ * 
+ * + * Protobuf type {@code a2a.v1.AgentProvider} + */ +@com.google.protobuf.Generated +public final class AgentProvider extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AgentProvider) + AgentProviderOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AgentProvider.class.getName()); + } + // Use AgentProvider.newBuilder() to construct. + private AgentProvider(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AgentProvider() { + url_ = ""; + organization_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentProvider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentProvider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentProvider.class, io.a2a.grpc.AgentProvider.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + *
+   * The providers reference url
+   * Example: "https://ai.google.dev"
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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(); + url_ = s; + return s; + } + } + /** + *
+   * The providers reference url
+   * Example: "https://ai.google.dev"
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORGANIZATION_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object organization_ = ""; + /** + *
+   * The providers organization name
+   * Example: "Google"
+   * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return The organization. + */ + @java.lang.Override + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + 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(); + organization_ = s; + return s; + } + } + /** + *
+   * The providers organization name
+   * Example: "Google"
+   * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return The bytes for organization. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + organization_ = 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.GeneratedMessage.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, url_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organization_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, organization_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, url_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organization_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, organization_); + } + 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 io.a2a.grpc.AgentProvider)) { + return super.equals(obj); + } + io.a2a.grpc.AgentProvider other = (io.a2a.grpc.AgentProvider) obj; + + if (!getUrl() + .equals(other.getUrl())) return false; + if (!getOrganization() + .equals(other.getOrganization())) 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) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + ORGANIZATION_FIELD_NUMBER; + hash = (53 * hash) + getOrganization().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AgentProvider parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentProvider parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentProvider parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentProvider parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentProvider parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentProvider parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentProvider parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentProvider parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AgentProvider parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AgentProvider parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AgentProvider parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentProvider parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AgentProvider 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Represents information about the service provider of an agent.
+   * 
+ * + * Protobuf type {@code a2a.v1.AgentProvider} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AgentProvider) + io.a2a.grpc.AgentProviderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentProvider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentProvider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentProvider.class, io.a2a.grpc.AgentProvider.Builder.class); + } + + // Construct using io.a2a.grpc.AgentProvider.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + url_ = ""; + organization_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentProvider_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AgentProvider getDefaultInstanceForType() { + return io.a2a.grpc.AgentProvider.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AgentProvider build() { + io.a2a.grpc.AgentProvider result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AgentProvider buildPartial() { + io.a2a.grpc.AgentProvider result = new io.a2a.grpc.AgentProvider(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.AgentProvider result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.url_ = url_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.organization_ = organization_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AgentProvider) { + return mergeFrom((io.a2a.grpc.AgentProvider)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AgentProvider other) { + if (other == io.a2a.grpc.AgentProvider.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getOrganization().isEmpty()) { + organization_ = other.organization_; + bitField0_ |= 0x00000002; + 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: { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + organization_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 url_ = ""; + /** + *
+     * The providers reference url
+     * Example: "https://ai.google.dev"
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The providers reference url
+     * Example: "https://ai.google.dev"
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The providers reference url
+     * Example: "https://ai.google.dev"
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + url_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The providers reference url
+     * Example: "https://ai.google.dev"
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The providers reference url
+     * Example: "https://ai.google.dev"
+     * 
+ * + * string url = 1 [json_name = "url"]; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object organization_ = ""; + /** + *
+     * The providers organization name
+     * Example: "Google"
+     * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return The organization. + */ + public java.lang.String getOrganization() { + java.lang.Object ref = organization_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + organization_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The providers organization name
+     * Example: "Google"
+     * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return The bytes for organization. + */ + public com.google.protobuf.ByteString + getOrganizationBytes() { + java.lang.Object ref = organization_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + organization_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The providers organization name
+     * Example: "Google"
+     * 
+ * + * string organization = 2 [json_name = "organization"]; + * @param value The organization to set. + * @return This builder for chaining. + */ + public Builder setOrganization( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + organization_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The providers organization name
+     * Example: "Google"
+     * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return This builder for chaining. + */ + public Builder clearOrganization() { + organization_ = getDefaultInstance().getOrganization(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The providers organization name
+     * Example: "Google"
+     * 
+ * + * string organization = 2 [json_name = "organization"]; + * @param value The bytes for organization to set. + * @return This builder for chaining. + */ + public Builder setOrganizationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + organization_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AgentProvider) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AgentProvider) + private static final io.a2a.grpc.AgentProvider DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AgentProvider(); + } + + public static io.a2a.grpc.AgentProvider getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AgentProvider 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 io.a2a.grpc.AgentProvider getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AgentProviderOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AgentProviderOrBuilder.java new file mode 100644 index 000000000..0a54dc18f --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentProviderOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AgentProviderOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AgentProvider) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The providers reference url
+   * Example: "https://ai.google.dev"
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The url. + */ + java.lang.String getUrl(); + /** + *
+   * The providers reference url
+   * Example: "https://ai.google.dev"
+   * 
+ * + * string url = 1 [json_name = "url"]; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * The providers organization name
+   * Example: "Google"
+   * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return The organization. + */ + java.lang.String getOrganization(); + /** + *
+   * The providers organization name
+   * Example: "Google"
+   * 
+ * + * string organization = 2 [json_name = "organization"]; + * @return The bytes for organization. + */ + com.google.protobuf.ByteString + getOrganizationBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AgentSkill.java b/grpc/src/main/java/io/a2a/grpc/AgentSkill.java new file mode 100644 index 000000000..c8d4dbf0b --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentSkill.java @@ -0,0 +1,1897 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * AgentSkill represents a unit of action/solution that the agent can perform.
+ * One can think of this as a type of highly reliable solution that an agent
+ * can be tasked to provide. Agents have the autonomy to choose how and when
+ * to use specific skills, but clients should have confidence that if the
+ * skill is defined that unit of action can be reliably performed.
+ * 
+ * + * Protobuf type {@code a2a.v1.AgentSkill} + */ +@com.google.protobuf.Generated +public final class AgentSkill extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AgentSkill) + AgentSkillOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AgentSkill.class.getName()); + } + // Use AgentSkill.newBuilder() to construct. + private AgentSkill(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AgentSkill() { + id_ = ""; + name_ = ""; + description_ = ""; + tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + examples_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + inputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + outputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentSkill_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentSkill_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentSkill.class, io.a2a.grpc.AgentSkill.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + *
+   * Unique id of the skill within this agent.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + *
+   * Unique id of the skill within this agent.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * A human readable name for the skill.
+   * 
+ * + * string name = 2 [json_name = "name"]; + * @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; + } + } + /** + *
+   * A human readable name for the skill.
+   * 
+ * + * string name = 2 [json_name = "name"]; + * @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 DESCRIPTION_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * A human (or llm) readable description of the skill
+   * details and behaviors.
+   * 
+ * + * string description = 3 [json_name = "description"]; + * @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 (or llm) readable description of the skill
+   * details and behaviors.
+   * 
+ * + * string description = 3 [json_name = "description"]; + * @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 TAGS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList + getTagsList() { + return tags_; + } + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString + getTagsBytes(int index) { + return tags_.getByteString(index); + } + + public static final int EXAMPLES_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList examples_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return A list containing the examples. + */ + public com.google.protobuf.ProtocolStringList + getExamplesList() { + return examples_; + } + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return The count of examples. + */ + public int getExamplesCount() { + return examples_.size(); + } + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index of the element to return. + * @return The examples at the given index. + */ + public java.lang.String getExamples(int index) { + return examples_.get(index); + } + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index of the value to return. + * @return The bytes of the examples at the given index. + */ + public com.google.protobuf.ByteString + getExamplesBytes(int index) { + return examples_.getByteString(index); + } + + public static final int INPUT_MODES_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList inputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return A list containing the inputModes. + */ + public com.google.protobuf.ProtocolStringList + getInputModesList() { + return inputModes_; + } + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return The count of inputModes. + */ + public int getInputModesCount() { + return inputModes_.size(); + } + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index of the element to return. + * @return The inputModes at the given index. + */ + public java.lang.String getInputModes(int index) { + return inputModes_.get(index); + } + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index of the value to return. + * @return The bytes of the inputModes at the given index. + */ + public com.google.protobuf.ByteString + getInputModesBytes(int index) { + return inputModes_.getByteString(index); + } + + public static final int OUTPUT_MODES_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList outputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return A list containing the outputModes. + */ + public com.google.protobuf.ProtocolStringList + getOutputModesList() { + return outputModes_; + } + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return The count of outputModes. + */ + public int getOutputModesCount() { + return outputModes_.size(); + } + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index of the element to return. + * @return The outputModes at the given index. + */ + public java.lang.String getOutputModes(int index) { + return outputModes_.get(index); + } + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index of the value to return. + * @return The bytes of the outputModes at the given index. + */ + public com.google.protobuf.ByteString + getOutputModesBytes(int index) { + return outputModes_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + for (int i = 0; i < tags_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, tags_.getRaw(i)); + } + for (int i = 0; i < examples_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, examples_.getRaw(i)); + } + for (int i = 0; i < inputModes_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, inputModes_.getRaw(i)); + } + for (int i = 0; i < outputModes_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, outputModes_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); + } + { + int dataSize = 0; + for (int i = 0; i < tags_.size(); i++) { + dataSize += computeStringSizeNoTag(tags_.getRaw(i)); + } + size += dataSize; + size += 1 * getTagsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < examples_.size(); i++) { + dataSize += computeStringSizeNoTag(examples_.getRaw(i)); + } + size += dataSize; + size += 1 * getExamplesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < inputModes_.size(); i++) { + dataSize += computeStringSizeNoTag(inputModes_.getRaw(i)); + } + size += dataSize; + size += 1 * getInputModesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < outputModes_.size(); i++) { + dataSize += computeStringSizeNoTag(outputModes_.getRaw(i)); + } + size += dataSize; + size += 1 * getOutputModesList().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 io.a2a.grpc.AgentSkill)) { + return super.equals(obj); + } + io.a2a.grpc.AgentSkill other = (io.a2a.grpc.AgentSkill) obj; + + if (!getId() + .equals(other.getId())) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getTagsList() + .equals(other.getTagsList())) return false; + if (!getExamplesList() + .equals(other.getExamplesList())) return false; + if (!getInputModesList() + .equals(other.getInputModesList())) return false; + if (!getOutputModesList() + .equals(other.getOutputModesList())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getTagsCount() > 0) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + getTagsList().hashCode(); + } + if (getExamplesCount() > 0) { + hash = (37 * hash) + EXAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getExamplesList().hashCode(); + } + if (getInputModesCount() > 0) { + hash = (37 * hash) + INPUT_MODES_FIELD_NUMBER; + hash = (53 * hash) + getInputModesList().hashCode(); + } + if (getOutputModesCount() > 0) { + hash = (37 * hash) + OUTPUT_MODES_FIELD_NUMBER; + hash = (53 * hash) + getOutputModesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AgentSkill parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentSkill parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentSkill parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentSkill parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentSkill parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AgentSkill parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AgentSkill parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentSkill parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AgentSkill parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AgentSkill parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AgentSkill parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AgentSkill parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AgentSkill 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * AgentSkill represents a unit of action/solution that the agent can perform.
+   * One can think of this as a type of highly reliable solution that an agent
+   * can be tasked to provide. Agents have the autonomy to choose how and when
+   * to use specific skills, but clients should have confidence that if the
+   * skill is defined that unit of action can be reliably performed.
+   * 
+ * + * Protobuf type {@code a2a.v1.AgentSkill} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AgentSkill) + io.a2a.grpc.AgentSkillOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentSkill_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentSkill_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AgentSkill.class, io.a2a.grpc.AgentSkill.Builder.class); + } + + // Construct using io.a2a.grpc.AgentSkill.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + name_ = ""; + description_ = ""; + tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + examples_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + inputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + outputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AgentSkill_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AgentSkill getDefaultInstanceForType() { + return io.a2a.grpc.AgentSkill.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AgentSkill build() { + io.a2a.grpc.AgentSkill result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AgentSkill buildPartial() { + io.a2a.grpc.AgentSkill result = new io.a2a.grpc.AgentSkill(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.AgentSkill result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + tags_.makeImmutable(); + result.tags_ = tags_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + examples_.makeImmutable(); + result.examples_ = examples_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + inputModes_.makeImmutable(); + result.inputModes_ = inputModes_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + outputModes_.makeImmutable(); + result.outputModes_ = outputModes_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AgentSkill) { + return mergeFrom((io.a2a.grpc.AgentSkill)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AgentSkill other) { + if (other == io.a2a.grpc.AgentSkill.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.tags_.isEmpty()) { + if (tags_.isEmpty()) { + tags_ = other.tags_; + bitField0_ |= 0x00000008; + } else { + ensureTagsIsMutable(); + tags_.addAll(other.tags_); + } + onChanged(); + } + if (!other.examples_.isEmpty()) { + if (examples_.isEmpty()) { + examples_ = other.examples_; + bitField0_ |= 0x00000010; + } else { + ensureExamplesIsMutable(); + examples_.addAll(other.examples_); + } + onChanged(); + } + if (!other.inputModes_.isEmpty()) { + if (inputModes_.isEmpty()) { + inputModes_ = other.inputModes_; + bitField0_ |= 0x00000020; + } else { + ensureInputModesIsMutable(); + inputModes_.addAll(other.inputModes_); + } + onChanged(); + } + if (!other.outputModes_.isEmpty()) { + if (outputModes_.isEmpty()) { + outputModes_ = other.outputModes_; + bitField0_ |= 0x00000040; + } else { + ensureOutputModesIsMutable(); + outputModes_.addAll(other.outputModes_); + } + 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: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + name_ = 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(); + ensureTagsIsMutable(); + tags_.add(s); + break; + } // case 34 + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + ensureExamplesIsMutable(); + examples_.add(s); + break; + } // case 42 + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + ensureInputModesIsMutable(); + inputModes_.add(s); + break; + } // case 50 + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + ensureOutputModesIsMutable(); + outputModes_.add(s); + 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 id_ = ""; + /** + *
+     * Unique id of the skill within this agent.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Unique id of the skill within this agent.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Unique id of the skill within this agent.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Unique id of the skill within this agent.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Unique id of the skill within this agent.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * A human readable name for the skill.
+     * 
+ * + * string name = 2 [json_name = "name"]; + * @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; + } + } + /** + *
+     * A human readable name for the skill.
+     * 
+ * + * string name = 2 [json_name = "name"]; + * @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; + } + } + /** + *
+     * A human readable name for the skill.
+     * 
+ * + * string name = 2 [json_name = "name"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A human readable name for the skill.
+     * 
+ * + * string name = 2 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A human readable name for the skill.
+     * 
+ * + * string name = 2 [json_name = "name"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * A human (or llm) readable description of the skill
+     * details and behaviors.
+     * 
+ * + * string description = 3 [json_name = "description"]; + * @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 (or llm) readable description of the skill
+     * details and behaviors.
+     * 
+ * + * string description = 3 [json_name = "description"]; + * @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 (or llm) readable description of the skill
+     * details and behaviors.
+     * 
+ * + * string description = 3 [json_name = "description"]; + * @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 (or llm) readable description of the skill
+     * details and behaviors.
+     * 
+ * + * string description = 3 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * A human (or llm) readable description of the skill
+     * details and behaviors.
+     * 
+ * + * string description = 3 [json_name = "description"]; + * @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 tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureTagsIsMutable() { + if (!tags_.isModifiable()) { + tags_ = new com.google.protobuf.LazyStringArrayList(tags_); + } + bitField0_ |= 0x00000008; + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return A list containing the tags. + */ + public com.google.protobuf.ProtocolStringList + getTagsList() { + tags_.makeImmutable(); + return tags_; + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return The count of tags. + */ + public int getTagsCount() { + return tags_.size(); + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index of the element to return. + * @return The tags at the given index. + */ + public java.lang.String getTags(int index) { + return tags_.get(index); + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + public com.google.protobuf.ByteString + getTagsBytes(int index) { + return tags_.getByteString(index); + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index to set the value at. + * @param value The tags to set. + * @return This builder for chaining. + */ + public Builder setTags( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTagsIsMutable(); + tags_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param value The tags to add. + * @return This builder for chaining. + */ + public Builder addTags( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureTagsIsMutable(); + tags_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param values The tags to add. + * @return This builder for chaining. + */ + public Builder addAllTags( + java.lang.Iterable values) { + ensureTagsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tags_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return This builder for chaining. + */ + public Builder clearTags() { + tags_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008);; + onChanged(); + return this; + } + /** + *
+     * A set of tags for the skill to enhance categorization/utilization.
+     * Example: ["cooking", "customer support", "billing"]
+     * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param value The bytes of the tags to add. + * @return This builder for chaining. + */ + public Builder addTagsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureTagsIsMutable(); + tags_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList examples_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureExamplesIsMutable() { + if (!examples_.isModifiable()) { + examples_ = new com.google.protobuf.LazyStringArrayList(examples_); + } + bitField0_ |= 0x00000010; + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return A list containing the examples. + */ + public com.google.protobuf.ProtocolStringList + getExamplesList() { + examples_.makeImmutable(); + return examples_; + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return The count of examples. + */ + public int getExamplesCount() { + return examples_.size(); + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index of the element to return. + * @return The examples at the given index. + */ + public java.lang.String getExamples(int index) { + return examples_.get(index); + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index of the value to return. + * @return The bytes of the examples at the given index. + */ + public com.google.protobuf.ByteString + getExamplesBytes(int index) { + return examples_.getByteString(index); + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index to set the value at. + * @param value The examples to set. + * @return This builder for chaining. + */ + public Builder setExamples( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExamplesIsMutable(); + examples_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param value The examples to add. + * @return This builder for chaining. + */ + public Builder addExamples( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExamplesIsMutable(); + examples_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param values The examples to add. + * @return This builder for chaining. + */ + public Builder addAllExamples( + java.lang.Iterable values) { + ensureExamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, examples_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return This builder for chaining. + */ + public Builder clearExamples() { + examples_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010);; + onChanged(); + return this; + } + /** + *
+     * A set of example queries that this skill is designed to address.
+     * These examples should help the caller to understand how to craft requests
+     * to the agent to achieve specific goals.
+     * Example: ["I need a recipe for bread"]
+     * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param value The bytes of the examples to add. + * @return This builder for chaining. + */ + public Builder addExamplesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureExamplesIsMutable(); + examples_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList inputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureInputModesIsMutable() { + if (!inputModes_.isModifiable()) { + inputModes_ = new com.google.protobuf.LazyStringArrayList(inputModes_); + } + bitField0_ |= 0x00000020; + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return A list containing the inputModes. + */ + public com.google.protobuf.ProtocolStringList + getInputModesList() { + inputModes_.makeImmutable(); + return inputModes_; + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return The count of inputModes. + */ + public int getInputModesCount() { + return inputModes_.size(); + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index of the element to return. + * @return The inputModes at the given index. + */ + public java.lang.String getInputModes(int index) { + return inputModes_.get(index); + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index of the value to return. + * @return The bytes of the inputModes at the given index. + */ + public com.google.protobuf.ByteString + getInputModesBytes(int index) { + return inputModes_.getByteString(index); + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index to set the value at. + * @param value The inputModes to set. + * @return This builder for chaining. + */ + public Builder setInputModes( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInputModesIsMutable(); + inputModes_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param value The inputModes to add. + * @return This builder for chaining. + */ + public Builder addInputModes( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureInputModesIsMutable(); + inputModes_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param values The inputModes to add. + * @return This builder for chaining. + */ + public Builder addAllInputModes( + java.lang.Iterable values) { + ensureInputModesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inputModes_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return This builder for chaining. + */ + public Builder clearInputModes() { + inputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020);; + onChanged(); + return this; + } + /** + *
+     * Possible input modalities supported.
+     * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param value The bytes of the inputModes to add. + * @return This builder for chaining. + */ + public Builder addInputModesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureInputModesIsMutable(); + inputModes_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList outputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureOutputModesIsMutable() { + if (!outputModes_.isModifiable()) { + outputModes_ = new com.google.protobuf.LazyStringArrayList(outputModes_); + } + bitField0_ |= 0x00000040; + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return A list containing the outputModes. + */ + public com.google.protobuf.ProtocolStringList + getOutputModesList() { + outputModes_.makeImmutable(); + return outputModes_; + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return The count of outputModes. + */ + public int getOutputModesCount() { + return outputModes_.size(); + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index of the element to return. + * @return The outputModes at the given index. + */ + public java.lang.String getOutputModes(int index) { + return outputModes_.get(index); + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index of the value to return. + * @return The bytes of the outputModes at the given index. + */ + public com.google.protobuf.ByteString + getOutputModesBytes(int index) { + return outputModes_.getByteString(index); + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index to set the value at. + * @param value The outputModes to set. + * @return This builder for chaining. + */ + public Builder setOutputModes( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOutputModesIsMutable(); + outputModes_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param value The outputModes to add. + * @return This builder for chaining. + */ + public Builder addOutputModes( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureOutputModesIsMutable(); + outputModes_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param values The outputModes to add. + * @return This builder for chaining. + */ + public Builder addAllOutputModes( + java.lang.Iterable values) { + ensureOutputModesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, outputModes_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return This builder for chaining. + */ + public Builder clearOutputModes() { + outputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040);; + onChanged(); + return this; + } + /** + *
+     * Possible output modalities produced
+     * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param value The bytes of the outputModes to add. + * @return This builder for chaining. + */ + public Builder addOutputModesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureOutputModesIsMutable(); + outputModes_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AgentSkill) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AgentSkill) + private static final io.a2a.grpc.AgentSkill DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AgentSkill(); + } + + public static io.a2a.grpc.AgentSkill getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AgentSkill 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 io.a2a.grpc.AgentSkill getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AgentSkillOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AgentSkillOrBuilder.java new file mode 100644 index 000000000..bfcb9d956 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AgentSkillOrBuilder.java @@ -0,0 +1,254 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AgentSkillOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AgentSkill) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Unique id of the skill within this agent.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + java.lang.String getId(); + /** + *
+   * Unique id of the skill within this agent.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * A human readable name for the skill.
+   * 
+ * + * string name = 2 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * A human readable name for the skill.
+   * 
+ * + * string name = 2 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A human (or llm) readable description of the skill
+   * details and behaviors.
+   * 
+ * + * string description = 3 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * A human (or llm) readable description of the skill
+   * details and behaviors.
+   * 
+ * + * string description = 3 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return A list containing the tags. + */ + java.util.List + getTagsList(); + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @return The count of tags. + */ + int getTagsCount(); + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index of the element to return. + * @return The tags at the given index. + */ + java.lang.String getTags(int index); + /** + *
+   * A set of tags for the skill to enhance categorization/utilization.
+   * Example: ["cooking", "customer support", "billing"]
+   * 
+ * + * repeated string tags = 4 [json_name = "tags"]; + * @param index The index of the value to return. + * @return The bytes of the tags at the given index. + */ + com.google.protobuf.ByteString + getTagsBytes(int index); + + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return A list containing the examples. + */ + java.util.List + getExamplesList(); + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @return The count of examples. + */ + int getExamplesCount(); + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index of the element to return. + * @return The examples at the given index. + */ + java.lang.String getExamples(int index); + /** + *
+   * A set of example queries that this skill is designed to address.
+   * These examples should help the caller to understand how to craft requests
+   * to the agent to achieve specific goals.
+   * Example: ["I need a recipe for bread"]
+   * 
+ * + * repeated string examples = 5 [json_name = "examples"]; + * @param index The index of the value to return. + * @return The bytes of the examples at the given index. + */ + com.google.protobuf.ByteString + getExamplesBytes(int index); + + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return A list containing the inputModes. + */ + java.util.List + getInputModesList(); + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @return The count of inputModes. + */ + int getInputModesCount(); + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index of the element to return. + * @return The inputModes at the given index. + */ + java.lang.String getInputModes(int index); + /** + *
+   * Possible input modalities supported.
+   * 
+ * + * repeated string input_modes = 6 [json_name = "inputModes"]; + * @param index The index of the value to return. + * @return The bytes of the inputModes at the given index. + */ + com.google.protobuf.ByteString + getInputModesBytes(int index); + + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return A list containing the outputModes. + */ + java.util.List + getOutputModesList(); + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @return The count of outputModes. + */ + int getOutputModesCount(); + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index of the element to return. + * @return The outputModes at the given index. + */ + java.lang.String getOutputModes(int index); + /** + *
+   * Possible output modalities produced
+   * 
+ * + * repeated string output_modes = 7 [json_name = "outputModes"]; + * @param index The index of the value to return. + * @return The bytes of the outputModes at the given index. + */ + com.google.protobuf.ByteString + getOutputModesBytes(int index); +} diff --git a/grpc/src/main/java/io/a2a/grpc/Artifact.java b/grpc/src/main/java/io/a2a/grpc/Artifact.java new file mode 100644 index 000000000..3e50bbcf8 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/Artifact.java @@ -0,0 +1,1799 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Artifacts are the container for task completed results. These are similar
+ * to Messages but are intended to be the product of a task, as opposed to
+ * point-to-point communication.
+ * 
+ * + * Protobuf type {@code a2a.v1.Artifact} + */ +@com.google.protobuf.Generated +public final class Artifact extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.Artifact) + ArtifactOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + Artifact.class.getName()); + } + // Use Artifact.newBuilder() to construct. + private Artifact(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Artifact() { + artifactId_ = ""; + name_ = ""; + description_ = ""; + parts_ = java.util.Collections.emptyList(); + extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Artifact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Artifact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Artifact.class, io.a2a.grpc.Artifact.Builder.class); + } + + private int bitField0_; + public static final int ARTIFACT_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object artifactId_ = ""; + /** + *
+   * Unique id for the artifact. It must be at least unique within a task.
+   * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return The artifactId. + */ + @java.lang.Override + public java.lang.String getArtifactId() { + java.lang.Object ref = artifactId_; + 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(); + artifactId_ = s; + return s; + } + } + /** + *
+   * Unique id for the artifact. It must be at least unique within a task.
+   * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return The bytes for artifactId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getArtifactIdBytes() { + java.lang.Object ref = artifactId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + artifactId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * A human readable name for the artifact.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @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; + } + } + /** + *
+   * A human readable name for the artifact.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @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 DESCRIPTION_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * A human readable description of the artifact, optional.
+   * 
+ * + * string description = 4 [json_name = "description"]; + * @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 artifact, optional.
+   * 
+ * + * string description = 4 [json_name = "description"]; + * @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 PARTS_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List parts_; + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + @java.lang.Override + public java.util.List getPartsList() { + return parts_; + } + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + @java.lang.Override + public java.util.List + getPartsOrBuilderList() { + return parts_; + } + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + @java.lang.Override + public int getPartsCount() { + return parts_.size(); + } + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + @java.lang.Override + public io.a2a.grpc.Part getParts(int index) { + return parts_.get(index); + } + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + @java.lang.Override + public io.a2a.grpc.PartOrBuilder getPartsOrBuilder( + int index) { + return parts_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct metadata_; + /** + *
+   * Optional metadata included with the artifact.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * Optional metadata included with the artifact.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + *
+   * Optional metadata included with the artifact.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + public static final int EXTENSIONS_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return A list containing the extensions. + */ + public com.google.protobuf.ProtocolStringList + getExtensionsList() { + return extensions_; + } + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return The count of extensions. + */ + public int getExtensionsCount() { + return extensions_.size(); + } + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the element to return. + * @return The extensions at the given index. + */ + public java.lang.String getExtensions(int index) { + return extensions_.get(index); + } + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the value to return. + * @return The bytes of the extensions at the given index. + */ + public com.google.protobuf.ByteString + getExtensionsBytes(int index) { + return extensions_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(artifactId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, artifactId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, description_); + } + for (int i = 0; i < parts_.size(); i++) { + output.writeMessage(5, parts_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getMetadata()); + } + for (int i = 0; i < extensions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, extensions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(artifactId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, artifactId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, description_); + } + for (int i = 0; i < parts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, parts_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getMetadata()); + } + { + int dataSize = 0; + for (int i = 0; i < extensions_.size(); i++) { + dataSize += computeStringSizeNoTag(extensions_.getRaw(i)); + } + size += dataSize; + size += 1 * getExtensionsList().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 io.a2a.grpc.Artifact)) { + return super.equals(obj); + } + io.a2a.grpc.Artifact other = (io.a2a.grpc.Artifact) obj; + + if (!getArtifactId() + .equals(other.getArtifactId())) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getPartsList() + .equals(other.getPartsList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) return false; + } + if (!getExtensionsList() + .equals(other.getExtensionsList())) 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) + ARTIFACT_ID_FIELD_NUMBER; + hash = (53 * hash) + getArtifactId().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getPartsCount() > 0) { + hash = (37 * hash) + PARTS_FIELD_NUMBER; + hash = (53 * hash) + getPartsList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getExtensionsCount() > 0) { + hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExtensionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.Artifact parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Artifact parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Artifact parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Artifact parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Artifact parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Artifact parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Artifact parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Artifact parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.Artifact parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.Artifact parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.Artifact parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Artifact parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.Artifact 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Artifacts are the container for task completed results. These are similar
+   * to Messages but are intended to be the product of a task, as opposed to
+   * point-to-point communication.
+   * 
+ * + * Protobuf type {@code a2a.v1.Artifact} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.Artifact) + io.a2a.grpc.ArtifactOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Artifact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Artifact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Artifact.class, io.a2a.grpc.Artifact.Builder.class); + } + + // Construct using io.a2a.grpc.Artifact.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetPartsFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + artifactId_ = ""; + name_ = ""; + description_ = ""; + if (partsBuilder_ == null) { + parts_ = java.util.Collections.emptyList(); + } else { + parts_ = null; + partsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Artifact_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.Artifact getDefaultInstanceForType() { + return io.a2a.grpc.Artifact.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.Artifact build() { + io.a2a.grpc.Artifact result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.Artifact buildPartial() { + io.a2a.grpc.Artifact result = new io.a2a.grpc.Artifact(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.a2a.grpc.Artifact result) { + if (partsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + parts_ = java.util.Collections.unmodifiableList(parts_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.parts_ = parts_; + } else { + result.parts_ = partsBuilder_.build(); + } + } + + private void buildPartial0(io.a2a.grpc.Artifact result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.artifactId_ = artifactId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.metadata_ = metadataBuilder_ == null + ? metadata_ + : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + extensions_.makeImmutable(); + result.extensions_ = extensions_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.Artifact) { + return mergeFrom((io.a2a.grpc.Artifact)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.Artifact other) { + if (other == io.a2a.grpc.Artifact.getDefaultInstance()) return this; + if (!other.getArtifactId().isEmpty()) { + artifactId_ = other.artifactId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (partsBuilder_ == null) { + if (!other.parts_.isEmpty()) { + if (parts_.isEmpty()) { + parts_ = other.parts_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePartsIsMutable(); + parts_.addAll(other.parts_); + } + onChanged(); + } + } else { + if (!other.parts_.isEmpty()) { + if (partsBuilder_.isEmpty()) { + partsBuilder_.dispose(); + partsBuilder_ = null; + parts_ = other.parts_; + bitField0_ = (bitField0_ & ~0x00000008); + partsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetPartsFieldBuilder() : null; + } else { + partsBuilder_.addAllMessages(other.parts_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.extensions_.isEmpty()) { + if (extensions_.isEmpty()) { + extensions_ = other.extensions_; + bitField0_ |= 0x00000020; + } else { + ensureExtensionsIsMutable(); + extensions_.addAll(other.extensions_); + } + 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: { + artifactId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: { + io.a2a.grpc.Part m = + input.readMessage( + io.a2a.grpc.Part.parser(), + extensionRegistry); + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(m); + } else { + partsBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + ensureExtensionsIsMutable(); + extensions_.add(s); + 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 artifactId_ = ""; + /** + *
+     * Unique id for the artifact. It must be at least unique within a task.
+     * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return The artifactId. + */ + public java.lang.String getArtifactId() { + java.lang.Object ref = artifactId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + artifactId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Unique id for the artifact. It must be at least unique within a task.
+     * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return The bytes for artifactId. + */ + public com.google.protobuf.ByteString + getArtifactIdBytes() { + java.lang.Object ref = artifactId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + artifactId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Unique id for the artifact. It must be at least unique within a task.
+     * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @param value The artifactId to set. + * @return This builder for chaining. + */ + public Builder setArtifactId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + artifactId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Unique id for the artifact. It must be at least unique within a task.
+     * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return This builder for chaining. + */ + public Builder clearArtifactId() { + artifactId_ = getDefaultInstance().getArtifactId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Unique id for the artifact. It must be at least unique within a task.
+     * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @param value The bytes for artifactId to set. + * @return This builder for chaining. + */ + public Builder setArtifactIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + artifactId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * A human readable name for the artifact.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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; + } + } + /** + *
+     * A human readable name for the artifact.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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; + } + } + /** + *
+     * A human readable name for the artifact.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A human readable name for the artifact.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A human readable name for the artifact.
+     * 
+ * + * string name = 3 [json_name = "name"]; + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * A human readable description of the artifact, optional.
+     * 
+ * + * string description = 4 [json_name = "description"]; + * @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 artifact, optional.
+     * 
+ * + * string description = 4 [json_name = "description"]; + * @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 artifact, optional.
+     * 
+ * + * string description = 4 [json_name = "description"]; + * @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 artifact, optional.
+     * 
+ * + * string description = 4 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * A human readable description of the artifact, optional.
+     * 
+ * + * string description = 4 [json_name = "description"]; + * @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 java.util.List parts_ = + java.util.Collections.emptyList(); + private void ensurePartsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + parts_ = new java.util.ArrayList(parts_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Part, io.a2a.grpc.Part.Builder, io.a2a.grpc.PartOrBuilder> partsBuilder_; + + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public java.util.List getPartsList() { + if (partsBuilder_ == null) { + return java.util.Collections.unmodifiableList(parts_); + } else { + return partsBuilder_.getMessageList(); + } + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public int getPartsCount() { + if (partsBuilder_ == null) { + return parts_.size(); + } else { + return partsBuilder_.getCount(); + } + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public io.a2a.grpc.Part getParts(int index) { + if (partsBuilder_ == null) { + return parts_.get(index); + } else { + return partsBuilder_.getMessage(index); + } + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder setParts( + int index, io.a2a.grpc.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.set(index, value); + onChanged(); + } else { + partsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder setParts( + int index, io.a2a.grpc.Part.Builder builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.set(index, builderForValue.build()); + onChanged(); + } else { + partsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder addParts(io.a2a.grpc.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.add(value); + onChanged(); + } else { + partsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder addParts( + int index, io.a2a.grpc.Part value) { + if (partsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartsIsMutable(); + parts_.add(index, value); + onChanged(); + } else { + partsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder addParts( + io.a2a.grpc.Part.Builder builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(builderForValue.build()); + onChanged(); + } else { + partsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder addParts( + int index, io.a2a.grpc.Part.Builder builderForValue) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.add(index, builderForValue.build()); + onChanged(); + } else { + partsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder addAllParts( + java.lang.Iterable values) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, parts_); + onChanged(); + } else { + partsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder clearParts() { + if (partsBuilder_ == null) { + parts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + partsBuilder_.clear(); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public Builder removeParts(int index) { + if (partsBuilder_ == null) { + ensurePartsIsMutable(); + parts_.remove(index); + onChanged(); + } else { + partsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public io.a2a.grpc.Part.Builder getPartsBuilder( + int index) { + return internalGetPartsFieldBuilder().getBuilder(index); + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public io.a2a.grpc.PartOrBuilder getPartsOrBuilder( + int index) { + if (partsBuilder_ == null) { + return parts_.get(index); } else { + return partsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public java.util.List + getPartsOrBuilderList() { + if (partsBuilder_ != null) { + return partsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parts_); + } + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public io.a2a.grpc.Part.Builder addPartsBuilder() { + return internalGetPartsFieldBuilder().addBuilder( + io.a2a.grpc.Part.getDefaultInstance()); + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public io.a2a.grpc.Part.Builder addPartsBuilder( + int index) { + return internalGetPartsFieldBuilder().addBuilder( + index, io.a2a.grpc.Part.getDefaultInstance()); + } + /** + *
+     * The content of the artifact.
+     * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + public java.util.List + getPartsBuilderList() { + return internalGetPartsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Part, io.a2a.grpc.Part.Builder, io.a2a.grpc.PartOrBuilder> + internalGetPartsFieldBuilder() { + if (partsBuilder_ == null) { + partsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Part, io.a2a.grpc.Part.Builder, io.a2a.grpc.PartOrBuilder>( + parts_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + parts_ = null; + } + return partsBuilder_; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata( + com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + metadata_ != null && + metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000010); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + *
+     * Optional metadata included with the artifact.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.protobuf.LazyStringArrayList extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureExtensionsIsMutable() { + if (!extensions_.isModifiable()) { + extensions_ = new com.google.protobuf.LazyStringArrayList(extensions_); + } + bitField0_ |= 0x00000020; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return A list containing the extensions. + */ + public com.google.protobuf.ProtocolStringList + getExtensionsList() { + extensions_.makeImmutable(); + return extensions_; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return The count of extensions. + */ + public int getExtensionsCount() { + return extensions_.size(); + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the element to return. + * @return The extensions at the given index. + */ + public java.lang.String getExtensions(int index) { + return extensions_.get(index); + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the value to return. + * @return The bytes of the extensions at the given index. + */ + public com.google.protobuf.ByteString + getExtensionsBytes(int index) { + return extensions_.getByteString(index); + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index to set the value at. + * @param value The extensions to set. + * @return This builder for chaining. + */ + public Builder setExtensions( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExtensionsIsMutable(); + extensions_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param value The extensions to add. + * @return This builder for chaining. + */ + public Builder addExtensions( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExtensionsIsMutable(); + extensions_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param values The extensions to add. + * @return This builder for chaining. + */ + public Builder addAllExtensions( + java.lang.Iterable values) { + ensureExtensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, extensions_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return This builder for chaining. + */ + public Builder clearExtensions() { + extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020);; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Artifact.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param value The bytes of the extensions to add. + * @return This builder for chaining. + */ + public Builder addExtensionsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureExtensionsIsMutable(); + extensions_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.Artifact) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.Artifact) + private static final io.a2a.grpc.Artifact DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.Artifact(); + } + + public static io.a2a.grpc.Artifact getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Artifact 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 io.a2a.grpc.Artifact getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/ArtifactOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/ArtifactOrBuilder.java new file mode 100644 index 000000000..54219afa3 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ArtifactOrBuilder.java @@ -0,0 +1,184 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface ArtifactOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.Artifact) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Unique id for the artifact. It must be at least unique within a task.
+   * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return The artifactId. + */ + java.lang.String getArtifactId(); + /** + *
+   * Unique id for the artifact. It must be at least unique within a task.
+   * 
+ * + * string artifact_id = 1 [json_name = "artifactId"]; + * @return The bytes for artifactId. + */ + com.google.protobuf.ByteString + getArtifactIdBytes(); + + /** + *
+   * A human readable name for the artifact.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * A human readable name for the artifact.
+   * 
+ * + * string name = 3 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A human readable description of the artifact, optional.
+   * 
+ * + * string description = 4 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * A human readable description of the artifact, optional.
+   * 
+ * + * string description = 4 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + java.util.List + getPartsList(); + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + io.a2a.grpc.Part getParts(int index); + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + int getPartsCount(); + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + java.util.List + getPartsOrBuilderList(); + /** + *
+   * The content of the artifact.
+   * 
+ * + * repeated .a2a.v1.Part parts = 5 [json_name = "parts"]; + */ + io.a2a.grpc.PartOrBuilder getPartsOrBuilder( + int index); + + /** + *
+   * Optional metadata included with the artifact.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * Optional metadata included with the artifact.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + *
+   * Optional metadata included with the artifact.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); + + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return A list containing the extensions. + */ + java.util.List + getExtensionsList(); + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return The count of extensions. + */ + int getExtensionsCount(); + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the element to return. + * @return The extensions at the given index. + */ + java.lang.String getExtensions(int index); + /** + *
+   * The URIs of extensions that are present or contributed to this Artifact.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the value to return. + * @return The bytes of the extensions at the given index. + */ + com.google.protobuf.ByteString + getExtensionsBytes(int index); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AuthenticationInfo.java b/grpc/src/main/java/io/a2a/grpc/AuthenticationInfo.java new file mode 100644 index 000000000..723f7164a --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AuthenticationInfo.java @@ -0,0 +1,779 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Defines authentication details, used for push notifications.
+ * 
+ * + * Protobuf type {@code a2a.v1.AuthenticationInfo} + */ +@com.google.protobuf.Generated +public final class AuthenticationInfo extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AuthenticationInfo) + AuthenticationInfoOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AuthenticationInfo.class.getName()); + } + // Use AuthenticationInfo.newBuilder() to construct. + private AuthenticationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AuthenticationInfo() { + schemes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + credentials_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AuthenticationInfo.class, io.a2a.grpc.AuthenticationInfo.Builder.class); + } + + public static final int SCHEMES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList schemes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return A list containing the schemes. + */ + public com.google.protobuf.ProtocolStringList + getSchemesList() { + return schemes_; + } + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return The count of schemes. + */ + public int getSchemesCount() { + return schemes_.size(); + } + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index of the element to return. + * @return The schemes at the given index. + */ + public java.lang.String getSchemes(int index) { + return schemes_.get(index); + } + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index of the value to return. + * @return The bytes of the schemes at the given index. + */ + public com.google.protobuf.ByteString + getSchemesBytes(int index) { + return schemes_.getByteString(index); + } + + public static final int CREDENTIALS_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object credentials_ = ""; + /** + *
+   * Optional credentials
+   * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return The credentials. + */ + @java.lang.Override + public java.lang.String getCredentials() { + java.lang.Object ref = credentials_; + 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(); + credentials_ = s; + return s; + } + } + /** + *
+   * Optional credentials
+   * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return The bytes for credentials. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCredentialsBytes() { + java.lang.Object ref = credentials_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + credentials_ = 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 { + for (int i = 0; i < schemes_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, schemes_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(credentials_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, credentials_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < schemes_.size(); i++) { + dataSize += computeStringSizeNoTag(schemes_.getRaw(i)); + } + size += dataSize; + size += 1 * getSchemesList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(credentials_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, credentials_); + } + 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 io.a2a.grpc.AuthenticationInfo)) { + return super.equals(obj); + } + io.a2a.grpc.AuthenticationInfo other = (io.a2a.grpc.AuthenticationInfo) obj; + + if (!getSchemesList() + .equals(other.getSchemesList())) return false; + if (!getCredentials() + .equals(other.getCredentials())) 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 (getSchemesCount() > 0) { + hash = (37 * hash) + SCHEMES_FIELD_NUMBER; + hash = (53 * hash) + getSchemesList().hashCode(); + } + hash = (37 * hash) + CREDENTIALS_FIELD_NUMBER; + hash = (53 * hash) + getCredentials().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AuthenticationInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AuthenticationInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AuthenticationInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Defines authentication details, used for push notifications.
+   * 
+ * + * Protobuf type {@code a2a.v1.AuthenticationInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AuthenticationInfo) + io.a2a.grpc.AuthenticationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AuthenticationInfo.class, io.a2a.grpc.AuthenticationInfo.Builder.class); + } + + // Construct using io.a2a.grpc.AuthenticationInfo.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + schemes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + credentials_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthenticationInfo_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AuthenticationInfo getDefaultInstanceForType() { + return io.a2a.grpc.AuthenticationInfo.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AuthenticationInfo build() { + io.a2a.grpc.AuthenticationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AuthenticationInfo buildPartial() { + io.a2a.grpc.AuthenticationInfo result = new io.a2a.grpc.AuthenticationInfo(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.AuthenticationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + schemes_.makeImmutable(); + result.schemes_ = schemes_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.credentials_ = credentials_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AuthenticationInfo) { + return mergeFrom((io.a2a.grpc.AuthenticationInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AuthenticationInfo other) { + if (other == io.a2a.grpc.AuthenticationInfo.getDefaultInstance()) return this; + if (!other.schemes_.isEmpty()) { + if (schemes_.isEmpty()) { + schemes_ = other.schemes_; + bitField0_ |= 0x00000001; + } else { + ensureSchemesIsMutable(); + schemes_.addAll(other.schemes_); + } + onChanged(); + } + if (!other.getCredentials().isEmpty()) { + credentials_ = other.credentials_; + bitField0_ |= 0x00000002; + 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: { + java.lang.String s = input.readStringRequireUtf8(); + ensureSchemesIsMutable(); + schemes_.add(s); + break; + } // case 10 + case 18: { + credentials_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 com.google.protobuf.LazyStringArrayList schemes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureSchemesIsMutable() { + if (!schemes_.isModifiable()) { + schemes_ = new com.google.protobuf.LazyStringArrayList(schemes_); + } + bitField0_ |= 0x00000001; + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return A list containing the schemes. + */ + public com.google.protobuf.ProtocolStringList + getSchemesList() { + schemes_.makeImmutable(); + return schemes_; + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return The count of schemes. + */ + public int getSchemesCount() { + return schemes_.size(); + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index of the element to return. + * @return The schemes at the given index. + */ + public java.lang.String getSchemes(int index) { + return schemes_.get(index); + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index of the value to return. + * @return The bytes of the schemes at the given index. + */ + public com.google.protobuf.ByteString + getSchemesBytes(int index) { + return schemes_.getByteString(index); + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index to set the value at. + * @param value The schemes to set. + * @return This builder for chaining. + */ + public Builder setSchemes( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureSchemesIsMutable(); + schemes_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param value The schemes to add. + * @return This builder for chaining. + */ + public Builder addSchemes( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureSchemesIsMutable(); + schemes_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param values The schemes to add. + * @return This builder for chaining. + */ + public Builder addAllSchemes( + java.lang.Iterable values) { + ensureSchemesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, schemes_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return This builder for chaining. + */ + public Builder clearSchemes() { + schemes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
+     * Supported authentication schemes - e.g. Basic, Bearer, etc
+     * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param value The bytes of the schemes to add. + * @return This builder for chaining. + */ + public Builder addSchemesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureSchemesIsMutable(); + schemes_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object credentials_ = ""; + /** + *
+     * Optional credentials
+     * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return The credentials. + */ + public java.lang.String getCredentials() { + java.lang.Object ref = credentials_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + credentials_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional credentials
+     * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return The bytes for credentials. + */ + public com.google.protobuf.ByteString + getCredentialsBytes() { + java.lang.Object ref = credentials_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + credentials_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional credentials
+     * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @param value The credentials to set. + * @return This builder for chaining. + */ + public Builder setCredentials( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + credentials_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Optional credentials
+     * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return This builder for chaining. + */ + public Builder clearCredentials() { + credentials_ = getDefaultInstance().getCredentials(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Optional credentials
+     * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @param value The bytes for credentials to set. + * @return This builder for chaining. + */ + public Builder setCredentialsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + credentials_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AuthenticationInfo) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AuthenticationInfo) + private static final io.a2a.grpc.AuthenticationInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AuthenticationInfo(); + } + + public static io.a2a.grpc.AuthenticationInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthenticationInfo 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 io.a2a.grpc.AuthenticationInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AuthenticationInfoOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AuthenticationInfoOrBuilder.java new file mode 100644 index 000000000..097b910e5 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AuthenticationInfoOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AuthenticationInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AuthenticationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return A list containing the schemes. + */ + java.util.List + getSchemesList(); + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @return The count of schemes. + */ + int getSchemesCount(); + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index of the element to return. + * @return The schemes at the given index. + */ + java.lang.String getSchemes(int index); + /** + *
+   * Supported authentication schemes - e.g. Basic, Bearer, etc
+   * 
+ * + * repeated string schemes = 1 [json_name = "schemes"]; + * @param index The index of the value to return. + * @return The bytes of the schemes at the given index. + */ + com.google.protobuf.ByteString + getSchemesBytes(int index); + + /** + *
+   * Optional credentials
+   * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return The credentials. + */ + java.lang.String getCredentials(); + /** + *
+   * Optional credentials
+   * 
+ * + * string credentials = 2 [json_name = "credentials"]; + * @return The bytes for credentials. + */ + com.google.protobuf.ByteString + getCredentialsBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/AuthorizationCodeOAuthFlow.java b/grpc/src/main/java/io/a2a/grpc/AuthorizationCodeOAuthFlow.java new file mode 100644 index 000000000..cbe26afb6 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AuthorizationCodeOAuthFlow.java @@ -0,0 +1,1213 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.AuthorizationCodeOAuthFlow} + */ +@com.google.protobuf.Generated +public final class AuthorizationCodeOAuthFlow extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.AuthorizationCodeOAuthFlow) + AuthorizationCodeOAuthFlowOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + AuthorizationCodeOAuthFlow.class.getName()); + } + // Use AuthorizationCodeOAuthFlow.newBuilder() to construct. + private AuthorizationCodeOAuthFlow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AuthorizationCodeOAuthFlow() { + authorizationUrl_ = ""; + tokenUrl_ = ""; + refreshUrl_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthorizationCodeOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AuthorizationCodeOAuthFlow.class, io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder.class); + } + + public static final int AUTHORIZATION_URL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object authorizationUrl_ = ""; + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The authorizationUrl. + */ + @java.lang.Override + public java.lang.String getAuthorizationUrl() { + java.lang.Object ref = authorizationUrl_; + 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(); + authorizationUrl_ = s; + return s; + } + } + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The bytes for authorizationUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAuthorizationUrlBytes() { + java.lang.Object ref = authorizationUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + authorizationUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOKEN_URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object tokenUrl_ = ""; + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + @java.lang.Override + public java.lang.String getTokenUrl() { + java.lang.Object ref = tokenUrl_; + 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(); + tokenUrl_ = s; + return s; + } + } + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTokenUrlBytes() { + java.lang.Object ref = tokenUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tokenUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFRESH_URL_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object refreshUrl_ = ""; + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + @java.lang.Override + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + 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(); + refreshUrl_ = s; + return s; + } + } + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCOPES_FIELD_NUMBER = 4; + private static final class ScopesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.a2a.grpc.A2A.internal_static_a2a_v1_AuthorizationCodeOAuthFlow_ScopesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(authorizationUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, authorizationUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tokenUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tokenUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, refreshUrl_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetScopes(), + ScopesDefaultEntryHolder.defaultEntry, + 4); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizationUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, authorizationUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tokenUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tokenUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, refreshUrl_); + } + for (java.util.Map.Entry entry + : internalGetScopes().getMap().entrySet()) { + com.google.protobuf.MapEntry + scopes__ = ScopesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, scopes__); + } + 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 io.a2a.grpc.AuthorizationCodeOAuthFlow)) { + return super.equals(obj); + } + io.a2a.grpc.AuthorizationCodeOAuthFlow other = (io.a2a.grpc.AuthorizationCodeOAuthFlow) obj; + + if (!getAuthorizationUrl() + .equals(other.getAuthorizationUrl())) return false; + if (!getTokenUrl() + .equals(other.getTokenUrl())) return false; + if (!getRefreshUrl() + .equals(other.getRefreshUrl())) return false; + if (!internalGetScopes().equals( + other.internalGetScopes())) 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) + AUTHORIZATION_URL_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationUrl().hashCode(); + hash = (37 * hash) + TOKEN_URL_FIELD_NUMBER; + hash = (53 * hash) + getTokenUrl().hashCode(); + hash = (37 * hash) + REFRESH_URL_FIELD_NUMBER; + hash = (53 * hash) + getRefreshUrl().hashCode(); + if (!internalGetScopes().getMap().isEmpty()) { + hash = (37 * hash) + SCOPES_FIELD_NUMBER; + hash = (53 * hash) + internalGetScopes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.AuthorizationCodeOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.AuthorizationCodeOAuthFlow 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.AuthorizationCodeOAuthFlow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.AuthorizationCodeOAuthFlow) + io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthorizationCodeOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.AuthorizationCodeOAuthFlow.class, io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder.class); + } + + // Construct using io.a2a.grpc.AuthorizationCodeOAuthFlow.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + authorizationUrl_ = ""; + tokenUrl_ = ""; + refreshUrl_ = ""; + internalGetMutableScopes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_AuthorizationCodeOAuthFlow_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlow getDefaultInstanceForType() { + return io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlow build() { + io.a2a.grpc.AuthorizationCodeOAuthFlow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlow buildPartial() { + io.a2a.grpc.AuthorizationCodeOAuthFlow result = new io.a2a.grpc.AuthorizationCodeOAuthFlow(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.AuthorizationCodeOAuthFlow result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.authorizationUrl_ = authorizationUrl_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tokenUrl_ = tokenUrl_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.refreshUrl_ = refreshUrl_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.scopes_ = internalGetScopes(); + result.scopes_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.AuthorizationCodeOAuthFlow) { + return mergeFrom((io.a2a.grpc.AuthorizationCodeOAuthFlow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.AuthorizationCodeOAuthFlow other) { + if (other == io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance()) return this; + if (!other.getAuthorizationUrl().isEmpty()) { + authorizationUrl_ = other.authorizationUrl_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTokenUrl().isEmpty()) { + tokenUrl_ = other.tokenUrl_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRefreshUrl().isEmpty()) { + refreshUrl_ = other.refreshUrl_; + bitField0_ |= 0x00000004; + onChanged(); + } + internalGetMutableScopes().mergeFrom( + other.internalGetScopes()); + bitField0_ |= 0x00000008; + 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: { + authorizationUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + tokenUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + refreshUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + com.google.protobuf.MapEntry + scopes__ = input.readMessage( + ScopesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableScopes().getMutableMap().put( + scopes__.getKey(), scopes__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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 authorizationUrl_ = ""; + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The authorizationUrl. + */ + public java.lang.String getAuthorizationUrl() { + java.lang.Object ref = authorizationUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizationUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The bytes for authorizationUrl. + */ + public com.google.protobuf.ByteString + getAuthorizationUrlBytes() { + java.lang.Object ref = authorizationUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + authorizationUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @param value The authorizationUrl to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + authorizationUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return This builder for chaining. + */ + public Builder clearAuthorizationUrl() { + authorizationUrl_ = getDefaultInstance().getAuthorizationUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @param value The bytes for authorizationUrl to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + authorizationUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tokenUrl_ = ""; + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + public java.lang.String getTokenUrl() { + java.lang.Object ref = tokenUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tokenUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + public com.google.protobuf.ByteString + getTokenUrlBytes() { + java.lang.Object ref = tokenUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tokenUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @param value The tokenUrl to set. + * @return This builder for chaining. + */ + public Builder setTokenUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tokenUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return This builder for chaining. + */ + public Builder clearTokenUrl() { + tokenUrl_ = getDefaultInstance().getTokenUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @param value The bytes for tokenUrl to set. + * @return This builder for chaining. + */ + public Builder setTokenUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tokenUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object refreshUrl_ = ""; + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refreshUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @param value The refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + refreshUrl_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return This builder for chaining. + */ + public Builder clearRefreshUrl() { + refreshUrl_ = getDefaultInstance().getRefreshUrl(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @param value The bytes for refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + refreshUrl_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + private com.google.protobuf.MapField + internalGetMutableScopes() { + if (scopes_ == null) { + scopes_ = com.google.protobuf.MapField.newMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + if (!scopes_.isMutable()) { + scopes_ = scopes_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearScopes() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableScopes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + public Builder removeScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableScopes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableScopes() { + bitField0_ |= 0x00000008; + return internalGetMutableScopes().getMutableMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + public Builder putScopes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableScopes().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + public Builder putAllScopes( + java.util.Map values) { + internalGetMutableScopes().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.AuthorizationCodeOAuthFlow) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.AuthorizationCodeOAuthFlow) + private static final io.a2a.grpc.AuthorizationCodeOAuthFlow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.AuthorizationCodeOAuthFlow(); + } + + public static io.a2a.grpc.AuthorizationCodeOAuthFlow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthorizationCodeOAuthFlow 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 io.a2a.grpc.AuthorizationCodeOAuthFlow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/AuthorizationCodeOAuthFlowOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/AuthorizationCodeOAuthFlowOrBuilder.java new file mode 100644 index 000000000..8e74a3d10 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/AuthorizationCodeOAuthFlowOrBuilder.java @@ -0,0 +1,137 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface AuthorizationCodeOAuthFlowOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.AuthorizationCodeOAuthFlow) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The authorizationUrl. + */ + java.lang.String getAuthorizationUrl(); + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The bytes for authorizationUrl. + */ + com.google.protobuf.ByteString + getAuthorizationUrlBytes(); + + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + java.lang.String getTokenUrl(); + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 2 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + com.google.protobuf.ByteString + getTokenUrlBytes(); + + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + java.lang.String getRefreshUrl(); + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 3 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + com.google.protobuf.ByteString + getRefreshUrlBytes(); + + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + int getScopesCount(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + boolean containsScopes( + java.lang.String key); + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getScopes(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + java.util.Map + getScopesMap(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 4 [json_name = "scopes"]; + */ + java.lang.String getScopesOrThrow( + java.lang.String key); +} diff --git a/grpc/src/main/java/io/a2a/grpc/CancelTaskRequest.java b/grpc/src/main/java/io/a2a/grpc/CancelTaskRequest.java new file mode 100644 index 000000000..a5120ff06 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/CancelTaskRequest.java @@ -0,0 +1,530 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.CancelTaskRequest} + */ +@com.google.protobuf.Generated +public final class CancelTaskRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.CancelTaskRequest) + CancelTaskRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + CancelTaskRequest.class.getName()); + } + // Use CancelTaskRequest.newBuilder() to construct. + private CancelTaskRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CancelTaskRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CancelTaskRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CancelTaskRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.CancelTaskRequest.class, io.a2a.grpc.CancelTaskRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.CancelTaskRequest)) { + return super.equals(obj); + } + io.a2a.grpc.CancelTaskRequest other = (io.a2a.grpc.CancelTaskRequest) 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 io.a2a.grpc.CancelTaskRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.CancelTaskRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.CancelTaskRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.CancelTaskRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.CancelTaskRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.CancelTaskRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.CancelTaskRequest) + io.a2a.grpc.CancelTaskRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CancelTaskRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CancelTaskRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.CancelTaskRequest.class, io.a2a.grpc.CancelTaskRequest.Builder.class); + } + + // Construct using io.a2a.grpc.CancelTaskRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.A2A.internal_static_a2a_v1_CancelTaskRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.CancelTaskRequest getDefaultInstanceForType() { + return io.a2a.grpc.CancelTaskRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.CancelTaskRequest build() { + io.a2a.grpc.CancelTaskRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.CancelTaskRequest buildPartial() { + io.a2a.grpc.CancelTaskRequest result = new io.a2a.grpc.CancelTaskRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.CancelTaskRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.CancelTaskRequest) { + return mergeFrom((io.a2a.grpc.CancelTaskRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.CancelTaskRequest other) { + if (other == io.a2a.grpc.CancelTaskRequest.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_ = ""; + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.CancelTaskRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.CancelTaskRequest) + private static final io.a2a.grpc.CancelTaskRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.CancelTaskRequest(); + } + + public static io.a2a.grpc.CancelTaskRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CancelTaskRequest 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 io.a2a.grpc.CancelTaskRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/CancelTaskRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/CancelTaskRequestOrBuilder.java new file mode 100644 index 000000000..4939f71e4 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/CancelTaskRequestOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface CancelTaskRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.CancelTaskRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/ClientCredentialsOAuthFlow.java b/grpc/src/main/java/io/a2a/grpc/ClientCredentialsOAuthFlow.java new file mode 100644 index 000000000..3a5be9442 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ClientCredentialsOAuthFlow.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.ClientCredentialsOAuthFlow} + */ +@com.google.protobuf.Generated +public final class ClientCredentialsOAuthFlow extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.ClientCredentialsOAuthFlow) + ClientCredentialsOAuthFlowOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + ClientCredentialsOAuthFlow.class.getName()); + } + // Use ClientCredentialsOAuthFlow.newBuilder() to construct. + private ClientCredentialsOAuthFlow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ClientCredentialsOAuthFlow() { + tokenUrl_ = ""; + refreshUrl_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ClientCredentialsOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ClientCredentialsOAuthFlow.class, io.a2a.grpc.ClientCredentialsOAuthFlow.Builder.class); + } + + public static final int TOKEN_URL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object tokenUrl_ = ""; + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + @java.lang.Override + public java.lang.String getTokenUrl() { + java.lang.Object ref = tokenUrl_; + 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(); + tokenUrl_ = s; + return s; + } + } + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTokenUrlBytes() { + java.lang.Object ref = tokenUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tokenUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFRESH_URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object refreshUrl_ = ""; + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + @java.lang.Override + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + 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(); + refreshUrl_ = s; + return s; + } + } + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCOPES_FIELD_NUMBER = 3; + private static final class ScopesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.a2a.grpc.A2A.internal_static_a2a_v1_ClientCredentialsOAuthFlow_ScopesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(tokenUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tokenUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, refreshUrl_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetScopes(), + ScopesDefaultEntryHolder.defaultEntry, + 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tokenUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tokenUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, refreshUrl_); + } + for (java.util.Map.Entry entry + : internalGetScopes().getMap().entrySet()) { + com.google.protobuf.MapEntry + scopes__ = ScopesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, scopes__); + } + 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 io.a2a.grpc.ClientCredentialsOAuthFlow)) { + return super.equals(obj); + } + io.a2a.grpc.ClientCredentialsOAuthFlow other = (io.a2a.grpc.ClientCredentialsOAuthFlow) obj; + + if (!getTokenUrl() + .equals(other.getTokenUrl())) return false; + if (!getRefreshUrl() + .equals(other.getRefreshUrl())) return false; + if (!internalGetScopes().equals( + other.internalGetScopes())) 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) + TOKEN_URL_FIELD_NUMBER; + hash = (53 * hash) + getTokenUrl().hashCode(); + hash = (37 * hash) + REFRESH_URL_FIELD_NUMBER; + hash = (53 * hash) + getRefreshUrl().hashCode(); + if (!internalGetScopes().getMap().isEmpty()) { + hash = (37 * hash) + SCOPES_FIELD_NUMBER; + hash = (53 * hash) + internalGetScopes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ClientCredentialsOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.ClientCredentialsOAuthFlow 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.ClientCredentialsOAuthFlow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.ClientCredentialsOAuthFlow) + io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ClientCredentialsOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ClientCredentialsOAuthFlow.class, io.a2a.grpc.ClientCredentialsOAuthFlow.Builder.class); + } + + // Construct using io.a2a.grpc.ClientCredentialsOAuthFlow.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tokenUrl_ = ""; + refreshUrl_ = ""; + internalGetMutableScopes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ClientCredentialsOAuthFlow_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlow getDefaultInstanceForType() { + return io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlow build() { + io.a2a.grpc.ClientCredentialsOAuthFlow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlow buildPartial() { + io.a2a.grpc.ClientCredentialsOAuthFlow result = new io.a2a.grpc.ClientCredentialsOAuthFlow(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.ClientCredentialsOAuthFlow result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tokenUrl_ = tokenUrl_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.refreshUrl_ = refreshUrl_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.scopes_ = internalGetScopes(); + result.scopes_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.ClientCredentialsOAuthFlow) { + return mergeFrom((io.a2a.grpc.ClientCredentialsOAuthFlow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.ClientCredentialsOAuthFlow other) { + if (other == io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance()) return this; + if (!other.getTokenUrl().isEmpty()) { + tokenUrl_ = other.tokenUrl_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRefreshUrl().isEmpty()) { + refreshUrl_ = other.refreshUrl_; + bitField0_ |= 0x00000002; + onChanged(); + } + internalGetMutableScopes().mergeFrom( + other.internalGetScopes()); + bitField0_ |= 0x00000004; + 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: { + tokenUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + refreshUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + scopes__ = input.readMessage( + ScopesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableScopes().getMutableMap().put( + scopes__.getKey(), scopes__.getValue()); + bitField0_ |= 0x00000004; + 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.lang.Object tokenUrl_ = ""; + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + public java.lang.String getTokenUrl() { + java.lang.Object ref = tokenUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tokenUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + public com.google.protobuf.ByteString + getTokenUrlBytes() { + java.lang.Object ref = tokenUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tokenUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @param value The tokenUrl to set. + * @return This builder for chaining. + */ + public Builder setTokenUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tokenUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return This builder for chaining. + */ + public Builder clearTokenUrl() { + tokenUrl_ = getDefaultInstance().getTokenUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @param value The bytes for tokenUrl to set. + * @return This builder for chaining. + */ + public Builder setTokenUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tokenUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object refreshUrl_ = ""; + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refreshUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @param value The refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + refreshUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return This builder for chaining. + */ + public Builder clearRefreshUrl() { + refreshUrl_ = getDefaultInstance().getRefreshUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @param value The bytes for refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + refreshUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + private com.google.protobuf.MapField + internalGetMutableScopes() { + if (scopes_ == null) { + scopes_ = com.google.protobuf.MapField.newMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + if (!scopes_.isMutable()) { + scopes_ = scopes_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearScopes() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableScopes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder removeScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableScopes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableScopes() { + bitField0_ |= 0x00000004; + return internalGetMutableScopes().getMutableMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder putScopes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableScopes().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder putAllScopes( + java.util.Map values) { + internalGetMutableScopes().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.ClientCredentialsOAuthFlow) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.ClientCredentialsOAuthFlow) + private static final io.a2a.grpc.ClientCredentialsOAuthFlow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.ClientCredentialsOAuthFlow(); + } + + public static io.a2a.grpc.ClientCredentialsOAuthFlow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClientCredentialsOAuthFlow 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 io.a2a.grpc.ClientCredentialsOAuthFlow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/ClientCredentialsOAuthFlowOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/ClientCredentialsOAuthFlowOrBuilder.java new file mode 100644 index 000000000..c1d3cd312 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ClientCredentialsOAuthFlowOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface ClientCredentialsOAuthFlowOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.ClientCredentialsOAuthFlow) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + java.lang.String getTokenUrl(); + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + com.google.protobuf.ByteString + getTokenUrlBytes(); + + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + java.lang.String getRefreshUrl(); + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + com.google.protobuf.ByteString + getRefreshUrlBytes(); + + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + int getScopesCount(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + boolean containsScopes( + java.lang.String key); + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getScopes(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + java.util.Map + getScopesMap(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + java.lang.String getScopesOrThrow( + java.lang.String key); +} diff --git a/grpc/src/main/java/io/a2a/grpc/CreateTaskPushNotificationConfigRequest.java b/grpc/src/main/java/io/a2a/grpc/CreateTaskPushNotificationConfigRequest.java new file mode 100644 index 000000000..966b0432b --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/CreateTaskPushNotificationConfigRequest.java @@ -0,0 +1,866 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.CreateTaskPushNotificationConfigRequest} + */ +@com.google.protobuf.Generated +public final class CreateTaskPushNotificationConfigRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.CreateTaskPushNotificationConfigRequest) + CreateTaskPushNotificationConfigRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + CreateTaskPushNotificationConfigRequest.class.getName()); + } + // Use CreateTaskPushNotificationConfigRequest.newBuilder() to construct. + private CreateTaskPushNotificationConfigRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private CreateTaskPushNotificationConfigRequest() { + parent_ = ""; + configId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.CreateTaskPushNotificationConfigRequest.class, io.a2a.grpc.CreateTaskPushNotificationConfigRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + *
+   * The task resource for this config.
+   * Format: tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+   * The task resource for this config.
+   * Format: tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @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 CONFIG_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object configId_ = ""; + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return The configId. + */ + @java.lang.Override + public java.lang.String getConfigId() { + java.lang.Object ref = configId_; + 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(); + configId_ = s; + return s; + } + } + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return The bytes for configId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConfigIdBytes() { + java.lang.Object ref = configId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + configId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIG_FIELD_NUMBER = 3; + private io.a2a.grpc.TaskPushNotificationConfig config_; + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfig getConfig() { + return config_ == null ? io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance() : config_; + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfigOrBuilder getConfigOrBuilder() { + return config_ == null ? io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance() : config_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(configId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, configId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(configId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, configId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getConfig()); + } + 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 io.a2a.grpc.CreateTaskPushNotificationConfigRequest)) { + return super.equals(obj); + } + io.a2a.grpc.CreateTaskPushNotificationConfigRequest other = (io.a2a.grpc.CreateTaskPushNotificationConfigRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (!getConfigId() + .equals(other.getConfigId())) return false; + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) 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) + CONFIG_ID_FIELD_NUMBER; + hash = (53 * hash) + getConfigId().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.CreateTaskPushNotificationConfigRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.CreateTaskPushNotificationConfigRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.CreateTaskPushNotificationConfigRequest) + io.a2a.grpc.CreateTaskPushNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.CreateTaskPushNotificationConfigRequest.class, io.a2a.grpc.CreateTaskPushNotificationConfigRequest.Builder.class); + } + + // Construct using io.a2a.grpc.CreateTaskPushNotificationConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetConfigFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + configId_ = ""; + config_ = null; + if (configBuilder_ != null) { + configBuilder_.dispose(); + configBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_CreateTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.CreateTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return io.a2a.grpc.CreateTaskPushNotificationConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.CreateTaskPushNotificationConfigRequest build() { + io.a2a.grpc.CreateTaskPushNotificationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.CreateTaskPushNotificationConfigRequest buildPartial() { + io.a2a.grpc.CreateTaskPushNotificationConfigRequest result = new io.a2a.grpc.CreateTaskPushNotificationConfigRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.CreateTaskPushNotificationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.configId_ = configId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.config_ = configBuilder_ == null + ? config_ + : configBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.CreateTaskPushNotificationConfigRequest) { + return mergeFrom((io.a2a.grpc.CreateTaskPushNotificationConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.CreateTaskPushNotificationConfigRequest other) { + if (other == io.a2a.grpc.CreateTaskPushNotificationConfigRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getConfigId().isEmpty()) { + configId_ = other.configId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + 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 18: { + configId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + 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.lang.Object parent_ = ""; + /** + *
+     * The task resource for this config.
+     * Format: tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * The task resource for this config.
+     * Format: tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * The task resource for this config.
+     * Format: tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + /** + *
+     * The task resource for this config.
+     * Format: tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The task resource for this config.
+     * Format: tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @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 java.lang.Object configId_ = ""; + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return The configId. + */ + public java.lang.String getConfigId() { + java.lang.Object ref = configId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + configId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return The bytes for configId. + */ + public com.google.protobuf.ByteString + getConfigIdBytes() { + java.lang.Object ref = configId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + configId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @param value The configId to set. + * @return This builder for chaining. + */ + public Builder setConfigId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + configId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearConfigId() { + configId_ = getDefaultInstance().getConfigId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for configId to set. + * @return This builder for chaining. + */ + public Builder setConfigIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + configId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private io.a2a.grpc.TaskPushNotificationConfig config_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskPushNotificationConfig, io.a2a.grpc.TaskPushNotificationConfig.Builder, io.a2a.grpc.TaskPushNotificationConfigOrBuilder> configBuilder_; + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public io.a2a.grpc.TaskPushNotificationConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(io.a2a.grpc.TaskPushNotificationConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + } else { + configBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + io.a2a.grpc.TaskPushNotificationConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(io.a2a.grpc.TaskPushNotificationConfig value) { + if (configBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + config_ != null && + config_ != io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance()) { + getConfigBuilder().mergeFrom(value); + } else { + config_ = value; + } + } else { + configBuilder_.mergeFrom(value); + } + if (config_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + config_ = null; + if (configBuilder_ != null) { + configBuilder_.dispose(); + configBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + public io.a2a.grpc.TaskPushNotificationConfig.Builder getConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetConfigFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + public io.a2a.grpc.TaskPushNotificationConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance() : config_; + } + } + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskPushNotificationConfig, io.a2a.grpc.TaskPushNotificationConfig.Builder, io.a2a.grpc.TaskPushNotificationConfigOrBuilder> + internalGetConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskPushNotificationConfig, io.a2a.grpc.TaskPushNotificationConfig.Builder, io.a2a.grpc.TaskPushNotificationConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.CreateTaskPushNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.CreateTaskPushNotificationConfigRequest) + private static final io.a2a.grpc.CreateTaskPushNotificationConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.CreateTaskPushNotificationConfigRequest(); + } + + public static io.a2a.grpc.CreateTaskPushNotificationConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTaskPushNotificationConfigRequest 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 io.a2a.grpc.CreateTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/CreateTaskPushNotificationConfigRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/CreateTaskPushNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..73fa1c0df --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/CreateTaskPushNotificationConfigRequestOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface CreateTaskPushNotificationConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.CreateTaskPushNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The task resource for this config.
+   * Format: tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * The task resource for this config.
+   * Format: tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent", (.google.api.field_behavior) = REQUIRED]; + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return The configId. + */ + java.lang.String getConfigId(); + /** + * string config_id = 2 [json_name = "configId", (.google.api.field_behavior) = REQUIRED]; + * @return The bytes for configId. + */ + com.google.protobuf.ByteString + getConfigIdBytes(); + + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + io.a2a.grpc.TaskPushNotificationConfig getConfig(); + /** + * .a2a.v1.TaskPushNotificationConfig config = 3 [json_name = "config", (.google.api.field_behavior) = REQUIRED]; + */ + io.a2a.grpc.TaskPushNotificationConfigOrBuilder getConfigOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/DataPart.java b/grpc/src/main/java/io/a2a/grpc/DataPart.java new file mode 100644 index 000000000..9b793b4bf --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/DataPart.java @@ -0,0 +1,567 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * DataPart represents a structured blob. This is most commonly a JSON payload.
+ * 
+ * + * Protobuf type {@code a2a.v1.DataPart} + */ +@com.google.protobuf.Generated +public final class DataPart extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.DataPart) + DataPartOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + DataPart.class.getName()); + } + // Use DataPart.newBuilder() to construct. + private DataPart(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DataPart() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DataPart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DataPart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.DataPart.class, io.a2a.grpc.DataPart.Builder.class); + } + + private int bitField0_; + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.Struct data_; + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.Struct getData() { + return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDataOrBuilder() { + return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getData()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getData()); + } + 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 io.a2a.grpc.DataPart)) { + return super.equals(obj); + } + io.a2a.grpc.DataPart other = (io.a2a.grpc.DataPart) obj; + + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) 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 (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.DataPart parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.DataPart parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.DataPart parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.DataPart parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.DataPart parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.DataPart parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.DataPart parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.DataPart parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.DataPart parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.DataPart parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.DataPart parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.DataPart parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.DataPart 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * DataPart represents a structured blob. This is most commonly a JSON payload.
+   * 
+ * + * Protobuf type {@code a2a.v1.DataPart} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.DataPart) + io.a2a.grpc.DataPartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DataPart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DataPart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.DataPart.class, io.a2a.grpc.DataPart.Builder.class); + } + + // Construct using io.a2a.grpc.DataPart.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetDataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DataPart_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.DataPart getDefaultInstanceForType() { + return io.a2a.grpc.DataPart.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.DataPart build() { + io.a2a.grpc.DataPart result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.DataPart buildPartial() { + io.a2a.grpc.DataPart result = new io.a2a.grpc.DataPart(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.DataPart result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.data_ = dataBuilder_ == null + ? data_ + : dataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.DataPart) { + return mergeFrom((io.a2a.grpc.DataPart)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.DataPart other) { + if (other == io.a2a.grpc.DataPart.getDefaultInstance()) return this; + if (other.hasData()) { + mergeData(other.getData()); + } + 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: { + input.readMessage( + internalGetDataFieldBuilder().getBuilder(), + extensionRegistry); + 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 com.google.protobuf.Struct data_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> dataBuilder_; + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + * @return Whether the data field is set. + */ + public boolean hasData() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + * @return The data. + */ + public com.google.protobuf.Struct getData() { + if (dataBuilder_ == null) { + return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + public Builder setData(com.google.protobuf.Struct value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + } else { + dataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + public Builder setData( + com.google.protobuf.Struct.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + public Builder mergeData(com.google.protobuf.Struct value) { + if (dataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + data_ != null && + data_ != com.google.protobuf.Struct.getDefaultInstance()) { + getDataBuilder().mergeFrom(value); + } else { + data_ = value; + } + } else { + dataBuilder_.mergeFrom(value); + } + if (data_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + public Builder clearData() { + bitField0_ = (bitField0_ & ~0x00000001); + data_ = null; + if (dataBuilder_ != null) { + dataBuilder_.dispose(); + dataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + public com.google.protobuf.Struct.Builder getDataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetDataFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + public com.google.protobuf.StructOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : data_; + } + } + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.DataPart) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.DataPart) + private static final io.a2a.grpc.DataPart DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.DataPart(); + } + + public static io.a2a.grpc.DataPart getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataPart 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 io.a2a.grpc.DataPart getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/DataPartOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/DataPartOrBuilder.java new file mode 100644 index 000000000..17f85b202 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/DataPartOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface DataPartOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.DataPart) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + * @return The data. + */ + com.google.protobuf.Struct getData(); + /** + * .google.protobuf.Struct data = 1 [json_name = "data"]; + */ + com.google.protobuf.StructOrBuilder getDataOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/DeleteTaskPushNotificationConfigRequest.java b/grpc/src/main/java/io/a2a/grpc/DeleteTaskPushNotificationConfigRequest.java new file mode 100644 index 000000000..afc374be5 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/DeleteTaskPushNotificationConfigRequest.java @@ -0,0 +1,530 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.DeleteTaskPushNotificationConfigRequest} + */ +@com.google.protobuf.Generated +public final class DeleteTaskPushNotificationConfigRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.DeleteTaskPushNotificationConfigRequest) + DeleteTaskPushNotificationConfigRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + DeleteTaskPushNotificationConfigRequest.class.getName()); + } + // Use DeleteTaskPushNotificationConfigRequest.newBuilder() to construct. + private DeleteTaskPushNotificationConfigRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DeleteTaskPushNotificationConfigRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.class, io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.DeleteTaskPushNotificationConfigRequest)) { + return super.equals(obj); + } + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest other = (io.a2a.grpc.DeleteTaskPushNotificationConfigRequest) 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 io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.DeleteTaskPushNotificationConfigRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.DeleteTaskPushNotificationConfigRequest) + io.a2a.grpc.DeleteTaskPushNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.class, io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.Builder.class); + } + + // Construct using io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.A2A.internal_static_a2a_v1_DeleteTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.DeleteTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.DeleteTaskPushNotificationConfigRequest build() { + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.DeleteTaskPushNotificationConfigRequest buildPartial() { + io.a2a.grpc.DeleteTaskPushNotificationConfigRequest result = new io.a2a.grpc.DeleteTaskPushNotificationConfigRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.DeleteTaskPushNotificationConfigRequest) { + return mergeFrom((io.a2a.grpc.DeleteTaskPushNotificationConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest other) { + if (other == io.a2a.grpc.DeleteTaskPushNotificationConfigRequest.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_ = ""; + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.DeleteTaskPushNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.DeleteTaskPushNotificationConfigRequest) + private static final io.a2a.grpc.DeleteTaskPushNotificationConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.DeleteTaskPushNotificationConfigRequest(); + } + + public static io.a2a.grpc.DeleteTaskPushNotificationConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTaskPushNotificationConfigRequest 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 io.a2a.grpc.DeleteTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/DeleteTaskPushNotificationConfigRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/DeleteTaskPushNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..c3c743692 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/DeleteTaskPushNotificationConfigRequestOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface DeleteTaskPushNotificationConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.DeleteTaskPushNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/FilePart.java b/grpc/src/main/java/io/a2a/grpc/FilePart.java new file mode 100644 index 000000000..fa85fef4a --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/FilePart.java @@ -0,0 +1,855 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * FilePart represents the different ways files can be provided. If files are
+ * small, directly feeding the bytes is supported via file_with_bytes. If the
+ * file is large, the agent should read the content as appropriate directly
+ * from the file_with_uri source.
+ * 
+ * + * Protobuf type {@code a2a.v1.FilePart} + */ +@com.google.protobuf.Generated +public final class FilePart extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.FilePart) + FilePartOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + FilePart.class.getName()); + } + // Use FilePart.newBuilder() to construct. + private FilePart(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private FilePart() { + mimeType_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_FilePart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_FilePart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.FilePart.class, io.a2a.grpc.FilePart.Builder.class); + } + + private int fileCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object file_; + public enum FileCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + FILE_WITH_URI(1), + FILE_WITH_BYTES(2), + FILE_NOT_SET(0); + private final int value; + private FileCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FileCase valueOf(int value) { + return forNumber(value); + } + + public static FileCase forNumber(int value) { + switch (value) { + case 1: return FILE_WITH_URI; + case 2: return FILE_WITH_BYTES; + case 0: return FILE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public FileCase + getFileCase() { + return FileCase.forNumber( + fileCase_); + } + + public static final int FILE_WITH_URI_FIELD_NUMBER = 1; + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return Whether the fileWithUri field is set. + */ + public boolean hasFileWithUri() { + return fileCase_ == 1; + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return The fileWithUri. + */ + public java.lang.String getFileWithUri() { + java.lang.Object ref = ""; + if (fileCase_ == 1) { + ref = file_; + } + 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(); + if (fileCase_ == 1) { + file_ = s; + } + return s; + } + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return The bytes for fileWithUri. + */ + public com.google.protobuf.ByteString + getFileWithUriBytes() { + java.lang.Object ref = ""; + if (fileCase_ == 1) { + ref = file_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (fileCase_ == 1) { + file_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_WITH_BYTES_FIELD_NUMBER = 2; + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return Whether the fileWithBytes field is set. + */ + @java.lang.Override + public boolean hasFileWithBytes() { + return fileCase_ == 2; + } + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return The fileWithBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileWithBytes() { + if (fileCase_ == 2) { + return (com.google.protobuf.ByteString) file_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int MIME_TYPE_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object mimeType_ = ""; + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return The mimeType. + */ + @java.lang.Override + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + 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(); + mimeType_ = s; + return s; + } + } + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return The bytes for mimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mimeType_ = 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 (fileCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, file_); + } + if (fileCase_ == 2) { + output.writeBytes( + 2, (com.google.protobuf.ByteString) file_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mimeType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, mimeType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (fileCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, file_); + } + if (fileCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 2, (com.google.protobuf.ByteString) file_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mimeType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, mimeType_); + } + 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 io.a2a.grpc.FilePart)) { + return super.equals(obj); + } + io.a2a.grpc.FilePart other = (io.a2a.grpc.FilePart) obj; + + if (!getMimeType() + .equals(other.getMimeType())) return false; + if (!getFileCase().equals(other.getFileCase())) return false; + switch (fileCase_) { + case 1: + if (!getFileWithUri() + .equals(other.getFileWithUri())) return false; + break; + case 2: + if (!getFileWithBytes() + .equals(other.getFileWithBytes())) return false; + break; + case 0: + default: + } + 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) + MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getMimeType().hashCode(); + switch (fileCase_) { + case 1: + hash = (37 * hash) + FILE_WITH_URI_FIELD_NUMBER; + hash = (53 * hash) + getFileWithUri().hashCode(); + break; + case 2: + hash = (37 * hash) + FILE_WITH_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getFileWithBytes().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.FilePart parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.FilePart parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.FilePart parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.FilePart parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.FilePart parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.FilePart parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.FilePart parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.FilePart parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.FilePart parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.FilePart parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.FilePart parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.FilePart parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.FilePart 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * FilePart represents the different ways files can be provided. If files are
+   * small, directly feeding the bytes is supported via file_with_bytes. If the
+   * file is large, the agent should read the content as appropriate directly
+   * from the file_with_uri source.
+   * 
+ * + * Protobuf type {@code a2a.v1.FilePart} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.FilePart) + io.a2a.grpc.FilePartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_FilePart_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_FilePart_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.FilePart.class, io.a2a.grpc.FilePart.Builder.class); + } + + // Construct using io.a2a.grpc.FilePart.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mimeType_ = ""; + fileCase_ = 0; + file_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_FilePart_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.FilePart getDefaultInstanceForType() { + return io.a2a.grpc.FilePart.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.FilePart build() { + io.a2a.grpc.FilePart result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.FilePart buildPartial() { + io.a2a.grpc.FilePart result = new io.a2a.grpc.FilePart(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.FilePart result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mimeType_ = mimeType_; + } + } + + private void buildPartialOneofs(io.a2a.grpc.FilePart result) { + result.fileCase_ = fileCase_; + result.file_ = this.file_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.FilePart) { + return mergeFrom((io.a2a.grpc.FilePart)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.FilePart other) { + if (other == io.a2a.grpc.FilePart.getDefaultInstance()) return this; + if (!other.getMimeType().isEmpty()) { + mimeType_ = other.mimeType_; + bitField0_ |= 0x00000004; + onChanged(); + } + switch (other.getFileCase()) { + case FILE_WITH_URI: { + fileCase_ = 1; + file_ = other.file_; + onChanged(); + break; + } + case FILE_WITH_BYTES: { + setFileWithBytes(other.getFileWithBytes()); + break; + } + case FILE_NOT_SET: { + break; + } + } + 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: { + java.lang.String s = input.readStringRequireUtf8(); + fileCase_ = 1; + file_ = s; + break; + } // case 10 + case 18: { + file_ = input.readBytes(); + fileCase_ = 2; + break; + } // case 18 + case 26: { + mimeType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 fileCase_ = 0; + private java.lang.Object file_; + public FileCase + getFileCase() { + return FileCase.forNumber( + fileCase_); + } + + public Builder clearFile() { + fileCase_ = 0; + file_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return Whether the fileWithUri field is set. + */ + @java.lang.Override + public boolean hasFileWithUri() { + return fileCase_ == 1; + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return The fileWithUri. + */ + @java.lang.Override + public java.lang.String getFileWithUri() { + java.lang.Object ref = ""; + if (fileCase_ == 1) { + ref = file_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (fileCase_ == 1) { + file_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return The bytes for fileWithUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFileWithUriBytes() { + java.lang.Object ref = ""; + if (fileCase_ == 1) { + ref = file_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (fileCase_ == 1) { + file_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @param value The fileWithUri to set. + * @return This builder for chaining. + */ + public Builder setFileWithUri( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + fileCase_ = 1; + file_ = value; + onChanged(); + return this; + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return This builder for chaining. + */ + public Builder clearFileWithUri() { + if (fileCase_ == 1) { + fileCase_ = 0; + file_ = null; + onChanged(); + } + return this; + } + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @param value The bytes for fileWithUri to set. + * @return This builder for chaining. + */ + public Builder setFileWithUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + fileCase_ = 1; + file_ = value; + onChanged(); + return this; + } + + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return Whether the fileWithBytes field is set. + */ + public boolean hasFileWithBytes() { + return fileCase_ == 2; + } + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return The fileWithBytes. + */ + public com.google.protobuf.ByteString getFileWithBytes() { + if (fileCase_ == 2) { + return (com.google.protobuf.ByteString) file_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @param value The fileWithBytes to set. + * @return This builder for chaining. + */ + public Builder setFileWithBytes(com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + fileCase_ = 2; + file_ = value; + onChanged(); + return this; + } + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return This builder for chaining. + */ + public Builder clearFileWithBytes() { + if (fileCase_ == 2) { + fileCase_ = 0; + file_ = null; + onChanged(); + } + return this; + } + + private java.lang.Object mimeType_ = ""; + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return The mimeType. + */ + public java.lang.String getMimeType() { + java.lang.Object ref = mimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return The bytes for mimeType. + */ + public com.google.protobuf.ByteString + getMimeTypeBytes() { + java.lang.Object ref = mimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + mimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @param value The mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeType( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + mimeType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return This builder for chaining. + */ + public Builder clearMimeType() { + mimeType_ = getDefaultInstance().getMimeType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @param value The bytes for mimeType to set. + * @return This builder for chaining. + */ + public Builder setMimeTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + mimeType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.FilePart) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.FilePart) + private static final io.a2a.grpc.FilePart DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.FilePart(); + } + + public static io.a2a.grpc.FilePart getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FilePart 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 io.a2a.grpc.FilePart getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/FilePartOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/FilePartOrBuilder.java new file mode 100644 index 000000000..d902f7a78 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/FilePartOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface FilePartOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.FilePart) + com.google.protobuf.MessageOrBuilder { + + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return Whether the fileWithUri field is set. + */ + boolean hasFileWithUri(); + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return The fileWithUri. + */ + java.lang.String getFileWithUri(); + /** + * string file_with_uri = 1 [json_name = "fileWithUri"]; + * @return The bytes for fileWithUri. + */ + com.google.protobuf.ByteString + getFileWithUriBytes(); + + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return Whether the fileWithBytes field is set. + */ + boolean hasFileWithBytes(); + /** + * bytes file_with_bytes = 2 [json_name = "fileWithBytes"]; + * @return The fileWithBytes. + */ + com.google.protobuf.ByteString getFileWithBytes(); + + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return The mimeType. + */ + java.lang.String getMimeType(); + /** + * string mime_type = 3 [json_name = "mimeType"]; + * @return The bytes for mimeType. + */ + com.google.protobuf.ByteString + getMimeTypeBytes(); + + io.a2a.grpc.FilePart.FileCase getFileCase(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/GetAgentCardRequest.java b/grpc/src/main/java/io/a2a/grpc/GetAgentCardRequest.java new file mode 100644 index 000000000..22f7e9499 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/GetAgentCardRequest.java @@ -0,0 +1,367 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Empty. Added to fix linter violation.
+ * 
+ * + * Protobuf type {@code a2a.v1.GetAgentCardRequest} + */ +@com.google.protobuf.Generated +public final class GetAgentCardRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.GetAgentCardRequest) + GetAgentCardRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + GetAgentCardRequest.class.getName()); + } + // Use GetAgentCardRequest.newBuilder() to construct. + private GetAgentCardRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GetAgentCardRequest() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetAgentCardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetAgentCardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.GetAgentCardRequest.class, io.a2a.grpc.GetAgentCardRequest.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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 io.a2a.grpc.GetAgentCardRequest)) { + return super.equals(obj); + } + io.a2a.grpc.GetAgentCardRequest other = (io.a2a.grpc.GetAgentCardRequest) obj; + + 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.GetAgentCardRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.GetAgentCardRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.GetAgentCardRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.GetAgentCardRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Empty. Added to fix linter violation.
+   * 
+ * + * Protobuf type {@code a2a.v1.GetAgentCardRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.GetAgentCardRequest) + io.a2a.grpc.GetAgentCardRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetAgentCardRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetAgentCardRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.GetAgentCardRequest.class, io.a2a.grpc.GetAgentCardRequest.Builder.class); + } + + // Construct using io.a2a.grpc.GetAgentCardRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetAgentCardRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.GetAgentCardRequest getDefaultInstanceForType() { + return io.a2a.grpc.GetAgentCardRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.GetAgentCardRequest build() { + io.a2a.grpc.GetAgentCardRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.GetAgentCardRequest buildPartial() { + io.a2a.grpc.GetAgentCardRequest result = new io.a2a.grpc.GetAgentCardRequest(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.GetAgentCardRequest) { + return mergeFrom((io.a2a.grpc.GetAgentCardRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.GetAgentCardRequest other) { + if (other == io.a2a.grpc.GetAgentCardRequest.getDefaultInstance()) return this; + 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; + 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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.GetAgentCardRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.GetAgentCardRequest) + private static final io.a2a.grpc.GetAgentCardRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.GetAgentCardRequest(); + } + + public static io.a2a.grpc.GetAgentCardRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAgentCardRequest 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 io.a2a.grpc.GetAgentCardRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/GetAgentCardRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/GetAgentCardRequestOrBuilder.java new file mode 100644 index 000000000..71311b5e0 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/GetAgentCardRequestOrBuilder.java @@ -0,0 +1,12 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface GetAgentCardRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.GetAgentCardRequest) + com.google.protobuf.MessageOrBuilder { +} diff --git a/grpc/src/main/java/io/a2a/grpc/GetTaskPushNotificationConfigRequest.java b/grpc/src/main/java/io/a2a/grpc/GetTaskPushNotificationConfigRequest.java new file mode 100644 index 000000000..f0720170c --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/GetTaskPushNotificationConfigRequest.java @@ -0,0 +1,530 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.GetTaskPushNotificationConfigRequest} + */ +@com.google.protobuf.Generated +public final class GetTaskPushNotificationConfigRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.GetTaskPushNotificationConfigRequest) + GetTaskPushNotificationConfigRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + GetTaskPushNotificationConfigRequest.class.getName()); + } + // Use GetTaskPushNotificationConfigRequest.newBuilder() to construct. + private GetTaskPushNotificationConfigRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GetTaskPushNotificationConfigRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.GetTaskPushNotificationConfigRequest.class, io.a2a.grpc.GetTaskPushNotificationConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.GetTaskPushNotificationConfigRequest)) { + return super.equals(obj); + } + io.a2a.grpc.GetTaskPushNotificationConfigRequest other = (io.a2a.grpc.GetTaskPushNotificationConfigRequest) 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 io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.GetTaskPushNotificationConfigRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.GetTaskPushNotificationConfigRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.GetTaskPushNotificationConfigRequest) + io.a2a.grpc.GetTaskPushNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.GetTaskPushNotificationConfigRequest.class, io.a2a.grpc.GetTaskPushNotificationConfigRequest.Builder.class); + } + + // Construct using io.a2a.grpc.GetTaskPushNotificationConfigRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.GetTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return io.a2a.grpc.GetTaskPushNotificationConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.GetTaskPushNotificationConfigRequest build() { + io.a2a.grpc.GetTaskPushNotificationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.GetTaskPushNotificationConfigRequest buildPartial() { + io.a2a.grpc.GetTaskPushNotificationConfigRequest result = new io.a2a.grpc.GetTaskPushNotificationConfigRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.GetTaskPushNotificationConfigRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.GetTaskPushNotificationConfigRequest) { + return mergeFrom((io.a2a.grpc.GetTaskPushNotificationConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.GetTaskPushNotificationConfigRequest other) { + if (other == io.a2a.grpc.GetTaskPushNotificationConfigRequest.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_ = ""; + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{push_id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.GetTaskPushNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.GetTaskPushNotificationConfigRequest) + private static final io.a2a.grpc.GetTaskPushNotificationConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.GetTaskPushNotificationConfigRequest(); + } + + public static io.a2a.grpc.GetTaskPushNotificationConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTaskPushNotificationConfigRequest 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 io.a2a.grpc.GetTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/GetTaskPushNotificationConfigRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/GetTaskPushNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..7502f36a7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/GetTaskPushNotificationConfigRequestOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface GetTaskPushNotificationConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.GetTaskPushNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{push_id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/GetTaskRequest.java b/grpc/src/main/java/io/a2a/grpc/GetTaskRequest.java new file mode 100644 index 000000000..08c0515fa --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/GetTaskRequest.java @@ -0,0 +1,596 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.GetTaskRequest} + */ +@com.google.protobuf.Generated +public final class GetTaskRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.GetTaskRequest) + GetTaskRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + GetTaskRequest.class.getName()); + } + // Use GetTaskRequest.newBuilder() to construct. + private GetTaskRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GetTaskRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.GetTaskRequest.class, io.a2a.grpc.GetTaskRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @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 HISTORY_LENGTH_FIELD_NUMBER = 2; + private int historyLength_ = 0; + /** + * int32 history_length = 2 [json_name = "historyLength"]; + * @return The historyLength. + */ + @java.lang.Override + public int getHistoryLength() { + return historyLength_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (historyLength_ != 0) { + output.writeInt32(2, historyLength_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (historyLength_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, historyLength_); + } + 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 io.a2a.grpc.GetTaskRequest)) { + return super.equals(obj); + } + io.a2a.grpc.GetTaskRequest other = (io.a2a.grpc.GetTaskRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getHistoryLength() + != other.getHistoryLength()) 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) + HISTORY_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getHistoryLength(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.GetTaskRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetTaskRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.GetTaskRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.GetTaskRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.GetTaskRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.GetTaskRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.GetTaskRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.GetTaskRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.GetTaskRequest) + io.a2a.grpc.GetTaskRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.GetTaskRequest.class, io.a2a.grpc.GetTaskRequest.Builder.class); + } + + // Construct using io.a2a.grpc.GetTaskRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + historyLength_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_GetTaskRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.GetTaskRequest getDefaultInstanceForType() { + return io.a2a.grpc.GetTaskRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.GetTaskRequest build() { + io.a2a.grpc.GetTaskRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.GetTaskRequest buildPartial() { + io.a2a.grpc.GetTaskRequest result = new io.a2a.grpc.GetTaskRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.GetTaskRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.historyLength_ = historyLength_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.GetTaskRequest) { + return mergeFrom((io.a2a.grpc.GetTaskRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.GetTaskRequest other) { + if (other == io.a2a.grpc.GetTaskRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getHistoryLength() != 0) { + setHistoryLength(other.getHistoryLength()); + } + 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 16: { + historyLength_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + 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_ = ""; + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @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; + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @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 int historyLength_ ; + /** + * int32 history_length = 2 [json_name = "historyLength"]; + * @return The historyLength. + */ + @java.lang.Override + public int getHistoryLength() { + return historyLength_; + } + /** + * int32 history_length = 2 [json_name = "historyLength"]; + * @param value The historyLength to set. + * @return This builder for chaining. + */ + public Builder setHistoryLength(int value) { + + historyLength_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 history_length = 2 [json_name = "historyLength"]; + * @return This builder for chaining. + */ + public Builder clearHistoryLength() { + bitField0_ = (bitField0_ & ~0x00000002); + historyLength_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.GetTaskRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.GetTaskRequest) + private static final io.a2a.grpc.GetTaskRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.GetTaskRequest(); + } + + public static io.a2a.grpc.GetTaskRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTaskRequest 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 io.a2a.grpc.GetTaskRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/GetTaskRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/GetTaskRequestOrBuilder.java new file mode 100644 index 000000000..0f55b196b --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/GetTaskRequestOrBuilder.java @@ -0,0 +1,38 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface GetTaskRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.GetTaskRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name", (.google.api.field_behavior) = REQUIRED]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * int32 history_length = 2 [json_name = "historyLength"]; + * @return The historyLength. + */ + int getHistoryLength(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/HTTPAuthSecurityScheme.java b/grpc/src/main/java/io/a2a/grpc/HTTPAuthSecurityScheme.java new file mode 100644 index 000000000..b6a093b85 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/HTTPAuthSecurityScheme.java @@ -0,0 +1,893 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.HTTPAuthSecurityScheme} + */ +@com.google.protobuf.Generated +public final class HTTPAuthSecurityScheme extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.HTTPAuthSecurityScheme) + HTTPAuthSecuritySchemeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + HTTPAuthSecurityScheme.class.getName()); + } + // Use HTTPAuthSecurityScheme.newBuilder() to construct. + private HTTPAuthSecurityScheme(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private HTTPAuthSecurityScheme() { + description_ = ""; + scheme_ = ""; + bearerFormat_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_HTTPAuthSecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_HTTPAuthSecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.HTTPAuthSecurityScheme.class, io.a2a.grpc.HTTPAuthSecurityScheme.Builder.class); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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 SCHEME_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object scheme_ = ""; + /** + *
+   * The name of the HTTP Authentication scheme to be used in the
+   * Authorization header as defined in RFC7235. The values used SHOULD be
+   * registered in the IANA Authentication Scheme registry.
+   * The value is case-insensitive, as defined in RFC7235.
+   * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return The scheme. + */ + @java.lang.Override + public java.lang.String getScheme() { + java.lang.Object ref = scheme_; + 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(); + scheme_ = s; + return s; + } + } + /** + *
+   * The name of the HTTP Authentication scheme to be used in the
+   * Authorization header as defined in RFC7235. The values used SHOULD be
+   * registered in the IANA Authentication Scheme registry.
+   * The value is case-insensitive, as defined in RFC7235.
+   * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return The bytes for scheme. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSchemeBytes() { + java.lang.Object ref = scheme_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + scheme_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BEARER_FORMAT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object bearerFormat_ = ""; + /** + *
+   * A hint to the client to identify how the bearer token is formatted.
+   * Bearer tokens are usually generated by an authorization server, so
+   * this information is primarily for documentation purposes.
+   * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return The bearerFormat. + */ + @java.lang.Override + public java.lang.String getBearerFormat() { + java.lang.Object ref = bearerFormat_; + 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(); + bearerFormat_ = s; + return s; + } + } + /** + *
+   * A hint to the client to identify how the bearer token is formatted.
+   * Bearer tokens are usually generated by an authorization server, so
+   * this information is primarily for documentation purposes.
+   * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return The bytes for bearerFormat. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBearerFormatBytes() { + java.lang.Object ref = bearerFormat_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bearerFormat_ = 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.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(scheme_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, scheme_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bearerFormat_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, bearerFormat_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(scheme_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, scheme_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bearerFormat_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, bearerFormat_); + } + 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 io.a2a.grpc.HTTPAuthSecurityScheme)) { + return super.equals(obj); + } + io.a2a.grpc.HTTPAuthSecurityScheme other = (io.a2a.grpc.HTTPAuthSecurityScheme) obj; + + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getScheme() + .equals(other.getScheme())) return false; + if (!getBearerFormat() + .equals(other.getBearerFormat())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + SCHEME_FIELD_NUMBER; + hash = (53 * hash) + getScheme().hashCode(); + hash = (37 * hash) + BEARER_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + getBearerFormat().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.HTTPAuthSecurityScheme parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.HTTPAuthSecurityScheme parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.HTTPAuthSecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.HTTPAuthSecurityScheme 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.HTTPAuthSecurityScheme} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.HTTPAuthSecurityScheme) + io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_HTTPAuthSecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_HTTPAuthSecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.HTTPAuthSecurityScheme.class, io.a2a.grpc.HTTPAuthSecurityScheme.Builder.class); + } + + // Construct using io.a2a.grpc.HTTPAuthSecurityScheme.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + description_ = ""; + scheme_ = ""; + bearerFormat_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_HTTPAuthSecurityScheme_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecurityScheme getDefaultInstanceForType() { + return io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecurityScheme build() { + io.a2a.grpc.HTTPAuthSecurityScheme result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecurityScheme buildPartial() { + io.a2a.grpc.HTTPAuthSecurityScheme result = new io.a2a.grpc.HTTPAuthSecurityScheme(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.HTTPAuthSecurityScheme result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.scheme_ = scheme_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bearerFormat_ = bearerFormat_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.HTTPAuthSecurityScheme) { + return mergeFrom((io.a2a.grpc.HTTPAuthSecurityScheme)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.HTTPAuthSecurityScheme other) { + if (other == io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getScheme().isEmpty()) { + scheme_ = other.scheme_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getBearerFormat().isEmpty()) { + bearerFormat_ = other.bearerFormat_; + bitField0_ |= 0x00000004; + 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: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + scheme_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + bearerFormat_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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.lang.Object description_ = ""; + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object scheme_ = ""; + /** + *
+     * The name of the HTTP Authentication scheme to be used in the
+     * Authorization header as defined in RFC7235. The values used SHOULD be
+     * registered in the IANA Authentication Scheme registry.
+     * The value is case-insensitive, as defined in RFC7235.
+     * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return The scheme. + */ + public java.lang.String getScheme() { + java.lang.Object ref = scheme_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + scheme_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the HTTP Authentication scheme to be used in the
+     * Authorization header as defined in RFC7235. The values used SHOULD be
+     * registered in the IANA Authentication Scheme registry.
+     * The value is case-insensitive, as defined in RFC7235.
+     * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return The bytes for scheme. + */ + public com.google.protobuf.ByteString + getSchemeBytes() { + java.lang.Object ref = scheme_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + scheme_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the HTTP Authentication scheme to be used in the
+     * Authorization header as defined in RFC7235. The values used SHOULD be
+     * registered in the IANA Authentication Scheme registry.
+     * The value is case-insensitive, as defined in RFC7235.
+     * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @param value The scheme to set. + * @return This builder for chaining. + */ + public Builder setScheme( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + scheme_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The name of the HTTP Authentication scheme to be used in the
+     * Authorization header as defined in RFC7235. The values used SHOULD be
+     * registered in the IANA Authentication Scheme registry.
+     * The value is case-insensitive, as defined in RFC7235.
+     * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return This builder for chaining. + */ + public Builder clearScheme() { + scheme_ = getDefaultInstance().getScheme(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The name of the HTTP Authentication scheme to be used in the
+     * Authorization header as defined in RFC7235. The values used SHOULD be
+     * registered in the IANA Authentication Scheme registry.
+     * The value is case-insensitive, as defined in RFC7235.
+     * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @param value The bytes for scheme to set. + * @return This builder for chaining. + */ + public Builder setSchemeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + scheme_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object bearerFormat_ = ""; + /** + *
+     * A hint to the client to identify how the bearer token is formatted.
+     * Bearer tokens are usually generated by an authorization server, so
+     * this information is primarily for documentation purposes.
+     * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return The bearerFormat. + */ + public java.lang.String getBearerFormat() { + java.lang.Object ref = bearerFormat_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bearerFormat_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A hint to the client to identify how the bearer token is formatted.
+     * Bearer tokens are usually generated by an authorization server, so
+     * this information is primarily for documentation purposes.
+     * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return The bytes for bearerFormat. + */ + public com.google.protobuf.ByteString + getBearerFormatBytes() { + java.lang.Object ref = bearerFormat_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + bearerFormat_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A hint to the client to identify how the bearer token is formatted.
+     * Bearer tokens are usually generated by an authorization server, so
+     * this information is primarily for documentation purposes.
+     * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @param value The bearerFormat to set. + * @return This builder for chaining. + */ + public Builder setBearerFormat( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + bearerFormat_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * A hint to the client to identify how the bearer token is formatted.
+     * Bearer tokens are usually generated by an authorization server, so
+     * this information is primarily for documentation purposes.
+     * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return This builder for chaining. + */ + public Builder clearBearerFormat() { + bearerFormat_ = getDefaultInstance().getBearerFormat(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * A hint to the client to identify how the bearer token is formatted.
+     * Bearer tokens are usually generated by an authorization server, so
+     * this information is primarily for documentation purposes.
+     * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @param value The bytes for bearerFormat to set. + * @return This builder for chaining. + */ + public Builder setBearerFormatBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + bearerFormat_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.HTTPAuthSecurityScheme) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.HTTPAuthSecurityScheme) + private static final io.a2a.grpc.HTTPAuthSecurityScheme DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.HTTPAuthSecurityScheme(); + } + + public static io.a2a.grpc.HTTPAuthSecurityScheme getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HTTPAuthSecurityScheme 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 io.a2a.grpc.HTTPAuthSecurityScheme getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/HTTPAuthSecuritySchemeOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/HTTPAuthSecuritySchemeOrBuilder.java new file mode 100644 index 000000000..90afd8f91 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/HTTPAuthSecuritySchemeOrBuilder.java @@ -0,0 +1,82 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface HTTPAuthSecuritySchemeOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.HTTPAuthSecurityScheme) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * The name of the HTTP Authentication scheme to be used in the
+   * Authorization header as defined in RFC7235. The values used SHOULD be
+   * registered in the IANA Authentication Scheme registry.
+   * The value is case-insensitive, as defined in RFC7235.
+   * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return The scheme. + */ + java.lang.String getScheme(); + /** + *
+   * The name of the HTTP Authentication scheme to be used in the
+   * Authorization header as defined in RFC7235. The values used SHOULD be
+   * registered in the IANA Authentication Scheme registry.
+   * The value is case-insensitive, as defined in RFC7235.
+   * 
+ * + * string scheme = 2 [json_name = "scheme"]; + * @return The bytes for scheme. + */ + com.google.protobuf.ByteString + getSchemeBytes(); + + /** + *
+   * A hint to the client to identify how the bearer token is formatted.
+   * Bearer tokens are usually generated by an authorization server, so
+   * this information is primarily for documentation purposes.
+   * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return The bearerFormat. + */ + java.lang.String getBearerFormat(); + /** + *
+   * A hint to the client to identify how the bearer token is formatted.
+   * Bearer tokens are usually generated by an authorization server, so
+   * this information is primarily for documentation purposes.
+   * 
+ * + * string bearer_format = 3 [json_name = "bearerFormat"]; + * @return The bytes for bearerFormat. + */ + com.google.protobuf.ByteString + getBearerFormatBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/ImplicitOAuthFlow.java b/grpc/src/main/java/io/a2a/grpc/ImplicitOAuthFlow.java new file mode 100644 index 000000000..450e158a9 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ImplicitOAuthFlow.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.ImplicitOAuthFlow} + */ +@com.google.protobuf.Generated +public final class ImplicitOAuthFlow extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.ImplicitOAuthFlow) + ImplicitOAuthFlowOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + ImplicitOAuthFlow.class.getName()); + } + // Use ImplicitOAuthFlow.newBuilder() to construct. + private ImplicitOAuthFlow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ImplicitOAuthFlow() { + authorizationUrl_ = ""; + refreshUrl_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ImplicitOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ImplicitOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ImplicitOAuthFlow.class, io.a2a.grpc.ImplicitOAuthFlow.Builder.class); + } + + public static final int AUTHORIZATION_URL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object authorizationUrl_ = ""; + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The authorizationUrl. + */ + @java.lang.Override + public java.lang.String getAuthorizationUrl() { + java.lang.Object ref = authorizationUrl_; + 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(); + authorizationUrl_ = s; + return s; + } + } + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The bytes for authorizationUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAuthorizationUrlBytes() { + java.lang.Object ref = authorizationUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + authorizationUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFRESH_URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object refreshUrl_ = ""; + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + @java.lang.Override + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + 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(); + refreshUrl_ = s; + return s; + } + } + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCOPES_FIELD_NUMBER = 3; + private static final class ScopesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.a2a.grpc.A2A.internal_static_a2a_v1_ImplicitOAuthFlow_ScopesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(authorizationUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, authorizationUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, refreshUrl_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetScopes(), + ScopesDefaultEntryHolder.defaultEntry, + 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizationUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, authorizationUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, refreshUrl_); + } + for (java.util.Map.Entry entry + : internalGetScopes().getMap().entrySet()) { + com.google.protobuf.MapEntry + scopes__ = ScopesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, scopes__); + } + 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 io.a2a.grpc.ImplicitOAuthFlow)) { + return super.equals(obj); + } + io.a2a.grpc.ImplicitOAuthFlow other = (io.a2a.grpc.ImplicitOAuthFlow) obj; + + if (!getAuthorizationUrl() + .equals(other.getAuthorizationUrl())) return false; + if (!getRefreshUrl() + .equals(other.getRefreshUrl())) return false; + if (!internalGetScopes().equals( + other.internalGetScopes())) 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) + AUTHORIZATION_URL_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationUrl().hashCode(); + hash = (37 * hash) + REFRESH_URL_FIELD_NUMBER; + hash = (53 * hash) + getRefreshUrl().hashCode(); + if (!internalGetScopes().getMap().isEmpty()) { + hash = (37 * hash) + SCOPES_FIELD_NUMBER; + hash = (53 * hash) + internalGetScopes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.ImplicitOAuthFlow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.ImplicitOAuthFlow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ImplicitOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.ImplicitOAuthFlow 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.ImplicitOAuthFlow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.ImplicitOAuthFlow) + io.a2a.grpc.ImplicitOAuthFlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ImplicitOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ImplicitOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ImplicitOAuthFlow.class, io.a2a.grpc.ImplicitOAuthFlow.Builder.class); + } + + // Construct using io.a2a.grpc.ImplicitOAuthFlow.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + authorizationUrl_ = ""; + refreshUrl_ = ""; + internalGetMutableScopes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ImplicitOAuthFlow_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlow getDefaultInstanceForType() { + return io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlow build() { + io.a2a.grpc.ImplicitOAuthFlow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlow buildPartial() { + io.a2a.grpc.ImplicitOAuthFlow result = new io.a2a.grpc.ImplicitOAuthFlow(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.ImplicitOAuthFlow result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.authorizationUrl_ = authorizationUrl_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.refreshUrl_ = refreshUrl_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.scopes_ = internalGetScopes(); + result.scopes_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.ImplicitOAuthFlow) { + return mergeFrom((io.a2a.grpc.ImplicitOAuthFlow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.ImplicitOAuthFlow other) { + if (other == io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance()) return this; + if (!other.getAuthorizationUrl().isEmpty()) { + authorizationUrl_ = other.authorizationUrl_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRefreshUrl().isEmpty()) { + refreshUrl_ = other.refreshUrl_; + bitField0_ |= 0x00000002; + onChanged(); + } + internalGetMutableScopes().mergeFrom( + other.internalGetScopes()); + bitField0_ |= 0x00000004; + 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: { + authorizationUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + refreshUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + scopes__ = input.readMessage( + ScopesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableScopes().getMutableMap().put( + scopes__.getKey(), scopes__.getValue()); + bitField0_ |= 0x00000004; + 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.lang.Object authorizationUrl_ = ""; + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The authorizationUrl. + */ + public java.lang.String getAuthorizationUrl() { + java.lang.Object ref = authorizationUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizationUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The bytes for authorizationUrl. + */ + public com.google.protobuf.ByteString + getAuthorizationUrlBytes() { + java.lang.Object ref = authorizationUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + authorizationUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @param value The authorizationUrl to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + authorizationUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return This builder for chaining. + */ + public Builder clearAuthorizationUrl() { + authorizationUrl_ = getDefaultInstance().getAuthorizationUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The authorization URL to be used for this flow. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS
+     * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @param value The bytes for authorizationUrl to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + authorizationUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object refreshUrl_ = ""; + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refreshUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @param value The refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + refreshUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return This builder for chaining. + */ + public Builder clearRefreshUrl() { + refreshUrl_ = getDefaultInstance().getRefreshUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @param value The bytes for refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + refreshUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + private com.google.protobuf.MapField + internalGetMutableScopes() { + if (scopes_ == null) { + scopes_ = com.google.protobuf.MapField.newMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + if (!scopes_.isMutable()) { + scopes_ = scopes_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearScopes() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableScopes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder removeScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableScopes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableScopes() { + bitField0_ |= 0x00000004; + return internalGetMutableScopes().getMutableMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder putScopes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableScopes().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder putAllScopes( + java.util.Map values) { + internalGetMutableScopes().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.ImplicitOAuthFlow) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.ImplicitOAuthFlow) + private static final io.a2a.grpc.ImplicitOAuthFlow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.ImplicitOAuthFlow(); + } + + public static io.a2a.grpc.ImplicitOAuthFlow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ImplicitOAuthFlow 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 io.a2a.grpc.ImplicitOAuthFlow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/ImplicitOAuthFlowOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/ImplicitOAuthFlowOrBuilder.java new file mode 100644 index 000000000..78616d7aa --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ImplicitOAuthFlowOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface ImplicitOAuthFlowOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.ImplicitOAuthFlow) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The authorizationUrl. + */ + java.lang.String getAuthorizationUrl(); + /** + *
+   * The authorization URL to be used for this flow. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS
+   * 
+ * + * string authorization_url = 1 [json_name = "authorizationUrl"]; + * @return The bytes for authorizationUrl. + */ + com.google.protobuf.ByteString + getAuthorizationUrlBytes(); + + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + java.lang.String getRefreshUrl(); + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + com.google.protobuf.ByteString + getRefreshUrlBytes(); + + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + int getScopesCount(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + boolean containsScopes( + java.lang.String key); + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getScopes(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + java.util.Map + getScopesMap(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + java.lang.String getScopesOrThrow( + java.lang.String key); +} diff --git a/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigRequest.java b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigRequest.java new file mode 100644 index 000000000..8ed2fc1a7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigRequest.java @@ -0,0 +1,819 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.ListTaskPushNotificationConfigRequest} + */ +@com.google.protobuf.Generated +public final class ListTaskPushNotificationConfigRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.ListTaskPushNotificationConfigRequest) + ListTaskPushNotificationConfigRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + ListTaskPushNotificationConfigRequest.class.getName()); + } + // Use ListTaskPushNotificationConfigRequest.newBuilder() to construct. + private ListTaskPushNotificationConfigRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ListTaskPushNotificationConfigRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ListTaskPushNotificationConfigRequest.class, io.a2a.grpc.ListTaskPushNotificationConfigRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + *
+   * parent=tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent"]; + * @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; + } + } + /** + *
+   * parent=tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent"]; + * @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; + /** + *
+   * For AIP-158 these fields are present. Usually not used/needed.
+   * The maximum number of configurations to return.
+   * If unspecified, all configs will be returned.
+   * 
+ * + * int32 page_size = 2 [json_name = "pageSize"]; + * @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_ = ""; + /** + *
+   * A page token received from a previous
+   * ListTaskPushNotificationConfigRequest call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * `ListTaskPushNotificationConfigRequest` must match the call that provided
+   * the page token.
+   * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @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; + } + } + /** + *
+   * A page token received from a previous
+   * ListTaskPushNotificationConfigRequest call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * `ListTaskPushNotificationConfigRequest` must match the call that provided
+   * the page token.
+   * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @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; + } + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + 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 io.a2a.grpc.ListTaskPushNotificationConfigRequest)) { + return super.equals(obj); + } + io.a2a.grpc.ListTaskPushNotificationConfigRequest other = (io.a2a.grpc.ListTaskPushNotificationConfigRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.ListTaskPushNotificationConfigRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.ListTaskPushNotificationConfigRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.ListTaskPushNotificationConfigRequest) + io.a2a.grpc.ListTaskPushNotificationConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ListTaskPushNotificationConfigRequest.class, io.a2a.grpc.ListTaskPushNotificationConfigRequest.Builder.class); + } + + // Construct using io.a2a.grpc.ListTaskPushNotificationConfigRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.ListTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return io.a2a.grpc.ListTaskPushNotificationConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.ListTaskPushNotificationConfigRequest build() { + io.a2a.grpc.ListTaskPushNotificationConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.ListTaskPushNotificationConfigRequest buildPartial() { + io.a2a.grpc.ListTaskPushNotificationConfigRequest result = new io.a2a.grpc.ListTaskPushNotificationConfigRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.ListTaskPushNotificationConfigRequest 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_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.ListTaskPushNotificationConfigRequest) { + return mergeFrom((io.a2a.grpc.ListTaskPushNotificationConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.ListTaskPushNotificationConfigRequest other) { + if (other == io.a2a.grpc.ListTaskPushNotificationConfigRequest.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(); + } + 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 + 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_ = ""; + /** + *
+     * parent=tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent"]; + * @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; + } + } + /** + *
+     * parent=tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent"]; + * @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; + } + } + /** + *
+     * parent=tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent"]; + * @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; + } + /** + *
+     * parent=tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent"]; + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * parent=tasks/{id}
+     * 
+ * + * string parent = 1 [json_name = "parent"]; + * @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_ ; + /** + *
+     * For AIP-158 these fields are present. Usually not used/needed.
+     * The maximum number of configurations to return.
+     * If unspecified, all configs will be returned.
+     * 
+ * + * int32 page_size = 2 [json_name = "pageSize"]; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * For AIP-158 these fields are present. Usually not used/needed.
+     * The maximum number of configurations to return.
+     * If unspecified, all configs will be returned.
+     * 
+ * + * int32 page_size = 2 [json_name = "pageSize"]; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * For AIP-158 these fields are present. Usually not used/needed.
+     * The maximum number of configurations to return.
+     * If unspecified, all configs will be returned.
+     * 
+ * + * int32 page_size = 2 [json_name = "pageSize"]; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A page token received from a previous
+     * ListTaskPushNotificationConfigRequest call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * `ListTaskPushNotificationConfigRequest` must match the call that provided
+     * the page token.
+     * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @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; + } + } + /** + *
+     * A page token received from a previous
+     * ListTaskPushNotificationConfigRequest call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * `ListTaskPushNotificationConfigRequest` must match the call that provided
+     * the page token.
+     * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @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; + } + } + /** + *
+     * A page token received from a previous
+     * ListTaskPushNotificationConfigRequest call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * `ListTaskPushNotificationConfigRequest` must match the call that provided
+     * the page token.
+     * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @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; + } + /** + *
+     * A page token received from a previous
+     * ListTaskPushNotificationConfigRequest call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * `ListTaskPushNotificationConfigRequest` must match the call that provided
+     * the page token.
+     * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * A page token received from a previous
+     * ListTaskPushNotificationConfigRequest call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to
+     * `ListTaskPushNotificationConfigRequest` must match the call that provided
+     * the page token.
+     * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.ListTaskPushNotificationConfigRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.ListTaskPushNotificationConfigRequest) + private static final io.a2a.grpc.ListTaskPushNotificationConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.ListTaskPushNotificationConfigRequest(); + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTaskPushNotificationConfigRequest 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 io.a2a.grpc.ListTaskPushNotificationConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigRequestOrBuilder.java new file mode 100644 index 000000000..1e6356045 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface ListTaskPushNotificationConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.ListTaskPushNotificationConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * parent=tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent"]; + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * parent=tasks/{id}
+   * 
+ * + * string parent = 1 [json_name = "parent"]; + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * For AIP-158 these fields are present. Usually not used/needed.
+   * The maximum number of configurations to return.
+   * If unspecified, all configs will be returned.
+   * 
+ * + * int32 page_size = 2 [json_name = "pageSize"]; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * A page token received from a previous
+   * ListTaskPushNotificationConfigRequest call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * `ListTaskPushNotificationConfigRequest` must match the call that provided
+   * the page token.
+   * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * A page token received from a previous
+   * ListTaskPushNotificationConfigRequest call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to
+   * `ListTaskPushNotificationConfigRequest` must match the call that provided
+   * the page token.
+   * 
+ * + * string page_token = 3 [json_name = "pageToken"]; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigResponse.java b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigResponse.java new file mode 100644 index 000000000..beb535430 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigResponse.java @@ -0,0 +1,891 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.ListTaskPushNotificationConfigResponse} + */ +@com.google.protobuf.Generated +public final class ListTaskPushNotificationConfigResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.ListTaskPushNotificationConfigResponse) + ListTaskPushNotificationConfigResponseOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + ListTaskPushNotificationConfigResponse.class.getName()); + } + // Use ListTaskPushNotificationConfigResponse.newBuilder() to construct. + private ListTaskPushNotificationConfigResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ListTaskPushNotificationConfigResponse() { + configs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ListTaskPushNotificationConfigResponse.class, io.a2a.grpc.ListTaskPushNotificationConfigResponse.Builder.class); + } + + public static final int CONFIGS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List configs_; + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + @java.lang.Override + public java.util.List getConfigsList() { + return configs_; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + @java.lang.Override + public java.util.List + getConfigsOrBuilderList() { + return configs_; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + @java.lang.Override + public int getConfigsCount() { + return configs_.size(); + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfig getConfigs(int index) { + return configs_.get(index); + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfigOrBuilder getConfigsOrBuilder( + int index) { + return configs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @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, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @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; + } + } + + 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 < configs_.size(); i++) { + output.writeMessage(1, configs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < configs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, configs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + 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 io.a2a.grpc.ListTaskPushNotificationConfigResponse)) { + return super.equals(obj); + } + io.a2a.grpc.ListTaskPushNotificationConfigResponse other = (io.a2a.grpc.ListTaskPushNotificationConfigResponse) obj; + + if (!getConfigsList() + .equals(other.getConfigsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) 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 (getConfigsCount() > 0) { + hash = (37 * hash) + CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.ListTaskPushNotificationConfigResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.ListTaskPushNotificationConfigResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.ListTaskPushNotificationConfigResponse) + io.a2a.grpc.ListTaskPushNotificationConfigResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.ListTaskPushNotificationConfigResponse.class, io.a2a.grpc.ListTaskPushNotificationConfigResponse.Builder.class); + } + + // Construct using io.a2a.grpc.ListTaskPushNotificationConfigResponse.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (configsBuilder_ == null) { + configs_ = java.util.Collections.emptyList(); + } else { + configs_ = null; + configsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_ListTaskPushNotificationConfigResponse_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.ListTaskPushNotificationConfigResponse getDefaultInstanceForType() { + return io.a2a.grpc.ListTaskPushNotificationConfigResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.ListTaskPushNotificationConfigResponse build() { + io.a2a.grpc.ListTaskPushNotificationConfigResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.ListTaskPushNotificationConfigResponse buildPartial() { + io.a2a.grpc.ListTaskPushNotificationConfigResponse result = new io.a2a.grpc.ListTaskPushNotificationConfigResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.a2a.grpc.ListTaskPushNotificationConfigResponse result) { + if (configsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + configs_ = java.util.Collections.unmodifiableList(configs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.configs_ = configs_; + } else { + result.configs_ = configsBuilder_.build(); + } + } + + private void buildPartial0(io.a2a.grpc.ListTaskPushNotificationConfigResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.ListTaskPushNotificationConfigResponse) { + return mergeFrom((io.a2a.grpc.ListTaskPushNotificationConfigResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.ListTaskPushNotificationConfigResponse other) { + if (other == io.a2a.grpc.ListTaskPushNotificationConfigResponse.getDefaultInstance()) return this; + if (configsBuilder_ == null) { + if (!other.configs_.isEmpty()) { + if (configs_.isEmpty()) { + configs_ = other.configs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfigsIsMutable(); + configs_.addAll(other.configs_); + } + onChanged(); + } + } else { + if (!other.configs_.isEmpty()) { + if (configsBuilder_.isEmpty()) { + configsBuilder_.dispose(); + configsBuilder_ = null; + configs_ = other.configs_; + bitField0_ = (bitField0_ & ~0x00000001); + configsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetConfigsFieldBuilder() : null; + } else { + configsBuilder_.addAllMessages(other.configs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + 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: { + io.a2a.grpc.TaskPushNotificationConfig m = + input.readMessage( + io.a2a.grpc.TaskPushNotificationConfig.parser(), + extensionRegistry); + if (configsBuilder_ == null) { + ensureConfigsIsMutable(); + configs_.add(m); + } else { + configsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 configs_ = + java.util.Collections.emptyList(); + private void ensureConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + configs_ = new java.util.ArrayList(configs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.TaskPushNotificationConfig, io.a2a.grpc.TaskPushNotificationConfig.Builder, io.a2a.grpc.TaskPushNotificationConfigOrBuilder> configsBuilder_; + + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public java.util.List getConfigsList() { + if (configsBuilder_ == null) { + return java.util.Collections.unmodifiableList(configs_); + } else { + return configsBuilder_.getMessageList(); + } + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public int getConfigsCount() { + if (configsBuilder_ == null) { + return configs_.size(); + } else { + return configsBuilder_.getCount(); + } + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public io.a2a.grpc.TaskPushNotificationConfig getConfigs(int index) { + if (configsBuilder_ == null) { + return configs_.get(index); + } else { + return configsBuilder_.getMessage(index); + } + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder setConfigs( + int index, io.a2a.grpc.TaskPushNotificationConfig value) { + if (configsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigsIsMutable(); + configs_.set(index, value); + onChanged(); + } else { + configsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder setConfigs( + int index, io.a2a.grpc.TaskPushNotificationConfig.Builder builderForValue) { + if (configsBuilder_ == null) { + ensureConfigsIsMutable(); + configs_.set(index, builderForValue.build()); + onChanged(); + } else { + configsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder addConfigs(io.a2a.grpc.TaskPushNotificationConfig value) { + if (configsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigsIsMutable(); + configs_.add(value); + onChanged(); + } else { + configsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder addConfigs( + int index, io.a2a.grpc.TaskPushNotificationConfig value) { + if (configsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigsIsMutable(); + configs_.add(index, value); + onChanged(); + } else { + configsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder addConfigs( + io.a2a.grpc.TaskPushNotificationConfig.Builder builderForValue) { + if (configsBuilder_ == null) { + ensureConfigsIsMutable(); + configs_.add(builderForValue.build()); + onChanged(); + } else { + configsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder addConfigs( + int index, io.a2a.grpc.TaskPushNotificationConfig.Builder builderForValue) { + if (configsBuilder_ == null) { + ensureConfigsIsMutable(); + configs_.add(index, builderForValue.build()); + onChanged(); + } else { + configsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder addAllConfigs( + java.lang.Iterable values) { + if (configsBuilder_ == null) { + ensureConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, configs_); + onChanged(); + } else { + configsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder clearConfigs() { + if (configsBuilder_ == null) { + configs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + configsBuilder_.clear(); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public Builder removeConfigs(int index) { + if (configsBuilder_ == null) { + ensureConfigsIsMutable(); + configs_.remove(index); + onChanged(); + } else { + configsBuilder_.remove(index); + } + return this; + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public io.a2a.grpc.TaskPushNotificationConfig.Builder getConfigsBuilder( + int index) { + return internalGetConfigsFieldBuilder().getBuilder(index); + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public io.a2a.grpc.TaskPushNotificationConfigOrBuilder getConfigsOrBuilder( + int index) { + if (configsBuilder_ == null) { + return configs_.get(index); } else { + return configsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public java.util.List + getConfigsOrBuilderList() { + if (configsBuilder_ != null) { + return configsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(configs_); + } + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public io.a2a.grpc.TaskPushNotificationConfig.Builder addConfigsBuilder() { + return internalGetConfigsFieldBuilder().addBuilder( + io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance()); + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public io.a2a.grpc.TaskPushNotificationConfig.Builder addConfigsBuilder( + int index) { + return internalGetConfigsFieldBuilder().addBuilder( + index, io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance()); + } + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + public java.util.List + getConfigsBuilderList() { + return internalGetConfigsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.TaskPushNotificationConfig, io.a2a.grpc.TaskPushNotificationConfig.Builder, io.a2a.grpc.TaskPushNotificationConfigOrBuilder> + internalGetConfigsFieldBuilder() { + if (configsBuilder_ == null) { + configsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.TaskPushNotificationConfig, io.a2a.grpc.TaskPushNotificationConfig.Builder, io.a2a.grpc.TaskPushNotificationConfigOrBuilder>( + configs_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + configs_ = null; + } + return configsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @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, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @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, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @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, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.ListTaskPushNotificationConfigResponse) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.ListTaskPushNotificationConfigResponse) + private static final io.a2a.grpc.ListTaskPushNotificationConfigResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.ListTaskPushNotificationConfigResponse(); + } + + public static io.a2a.grpc.ListTaskPushNotificationConfigResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTaskPushNotificationConfigResponse 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 io.a2a.grpc.ListTaskPushNotificationConfigResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigResponseOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigResponseOrBuilder.java new file mode 100644 index 000000000..211aeee5a --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/ListTaskPushNotificationConfigResponseOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface ListTaskPushNotificationConfigResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.ListTaskPushNotificationConfigResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + java.util.List + getConfigsList(); + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + io.a2a.grpc.TaskPushNotificationConfig getConfigs(int index); + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + int getConfigsCount(); + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + java.util.List + getConfigsOrBuilderList(); + /** + * repeated .a2a.v1.TaskPushNotificationConfig configs = 1 [json_name = "configs"]; + */ + io.a2a.grpc.TaskPushNotificationConfigOrBuilder getConfigsOrBuilder( + int index); + + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2 [json_name = "nextPageToken"]; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/Message.java b/grpc/src/main/java/io/a2a/grpc/Message.java new file mode 100644 index 000000000..cddcf43e5 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/Message.java @@ -0,0 +1,1983 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Message is one unit of communication between client and server. It is
+ * associated with a context and optionally a task. Since the server is
+ * responsible for the context definition, it must always provide a context_id
+ * in its messages. The client can optionally provide the context_id if it
+ * knows the context to associate the message to. Similarly for task_id,
+ * except the server decides if a task is created and whether to include the
+ * task_id.
+ * 
+ * + * Protobuf type {@code a2a.v1.Message} + */ +@com.google.protobuf.Generated +public final class Message extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.Message) + MessageOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + Message.class.getName()); + } + // Use Message.newBuilder() to construct. + private Message(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Message() { + messageId_ = ""; + contextId_ = ""; + taskId_ = ""; + role_ = 0; + content_ = java.util.Collections.emptyList(); + extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Message.class, io.a2a.grpc.Message.Builder.class); + } + + private int bitField0_; + public static final int MESSAGE_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object messageId_ = ""; + /** + *
+   * The message id of the message. This is required and created by the
+   * message creator.
+   * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return The messageId. + */ + @java.lang.Override + public java.lang.String getMessageId() { + java.lang.Object ref = messageId_; + 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(); + messageId_ = s; + return s; + } + } + /** + *
+   * The message id of the message. This is required and created by the
+   * message creator.
+   * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return The bytes for messageId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageIdBytes() { + java.lang.Object ref = messageId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + messageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object contextId_ = ""; + /** + *
+   * The context id of the message. This is optional and if set, the message
+   * will be associated with the given context.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + @java.lang.Override + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + 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(); + contextId_ = s; + return s; + } + } + /** + *
+   * The context id of the message. This is optional and if set, the message
+   * will be associated with the given context.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TASK_ID_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object taskId_ = ""; + /** + *
+   * The task id of the message. This is optional and if set, the message
+   * will be associated with the given task.
+   * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return The taskId. + */ + @java.lang.Override + public java.lang.String getTaskId() { + java.lang.Object ref = taskId_; + 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(); + taskId_ = s; + return s; + } + } + /** + *
+   * The task id of the message. This is optional and if set, the message
+   * will be associated with the given task.
+   * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTaskIdBytes() { + java.lang.Object ref = taskId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ROLE_FIELD_NUMBER = 4; + private int role_ = 0; + /** + *
+   * A role for the message.
+   * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override public int getRoleValue() { + return role_; + } + /** + *
+   * A role for the message.
+   * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return The role. + */ + @java.lang.Override public io.a2a.grpc.Role getRole() { + io.a2a.grpc.Role result = io.a2a.grpc.Role.forNumber(role_); + return result == null ? io.a2a.grpc.Role.UNRECOGNIZED : result; + } + + public static final int CONTENT_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List content_; + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + @java.lang.Override + public java.util.List getContentList() { + return content_; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + @java.lang.Override + public java.util.List + getContentOrBuilderList() { + return content_; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + @java.lang.Override + public int getContentCount() { + return content_.size(); + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + @java.lang.Override + public io.a2a.grpc.Part getContent(int index) { + return content_.get(index); + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + @java.lang.Override + public io.a2a.grpc.PartOrBuilder getContentOrBuilder( + int index) { + return content_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct metadata_; + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * Any optional metadata to provide along with the message.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * Any optional metadata to provide along with the message.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * Any optional metadata to provide along with the message.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + public static final int EXTENSIONS_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return A list containing the extensions. + */ + public com.google.protobuf.ProtocolStringList + getExtensionsList() { + return extensions_; + } + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return The count of extensions. + */ + public int getExtensionsCount() { + return extensions_.size(); + } + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the element to return. + * @return The extensions at the given index. + */ + public java.lang.String getExtensions(int index) { + return extensions_.get(index); + } + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the value to return. + * @return The bytes of the extensions at the given index. + */ + public com.google.protobuf.ByteString + getExtensionsBytes(int index) { + return extensions_.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 { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(messageId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, messageId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, contextId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(taskId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, taskId_); + } + if (role_ != io.a2a.grpc.Role.ROLE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, role_); + } + for (int i = 0; i < content_.size(); i++) { + output.writeMessage(5, content_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getMetadata()); + } + for (int i = 0; i < extensions_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, extensions_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(messageId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, messageId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, contextId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(taskId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, taskId_); + } + if (role_ != io.a2a.grpc.Role.ROLE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, role_); + } + for (int i = 0; i < content_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, content_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getMetadata()); + } + { + int dataSize = 0; + for (int i = 0; i < extensions_.size(); i++) { + dataSize += computeStringSizeNoTag(extensions_.getRaw(i)); + } + size += dataSize; + size += 1 * getExtensionsList().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 io.a2a.grpc.Message)) { + return super.equals(obj); + } + io.a2a.grpc.Message other = (io.a2a.grpc.Message) obj; + + if (!getMessageId() + .equals(other.getMessageId())) return false; + if (!getContextId() + .equals(other.getContextId())) return false; + if (!getTaskId() + .equals(other.getTaskId())) return false; + if (role_ != other.role_) return false; + if (!getContentList() + .equals(other.getContentList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) return false; + } + if (!getExtensionsList() + .equals(other.getExtensionsList())) 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) + MESSAGE_ID_FIELD_NUMBER; + hash = (53 * hash) + getMessageId().hashCode(); + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + hash = (37 * hash) + TASK_ID_FIELD_NUMBER; + hash = (53 * hash) + getTaskId().hashCode(); + hash = (37 * hash) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + role_; + if (getContentCount() > 0) { + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContentList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + if (getExtensionsCount() > 0) { + hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExtensionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.Message parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Message parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Message parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Message parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Message parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Message parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Message parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Message parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.Message parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.Message parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.Message parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Message parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.Message 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message is one unit of communication between client and server. It is
+   * associated with a context and optionally a task. Since the server is
+   * responsible for the context definition, it must always provide a context_id
+   * in its messages. The client can optionally provide the context_id if it
+   * knows the context to associate the message to. Similarly for task_id,
+   * except the server decides if a task is created and whether to include the
+   * task_id.
+   * 
+ * + * Protobuf type {@code a2a.v1.Message} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.Message) + io.a2a.grpc.MessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Message_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Message_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Message.class, io.a2a.grpc.Message.Builder.class); + } + + // Construct using io.a2a.grpc.Message.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetContentFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + messageId_ = ""; + contextId_ = ""; + taskId_ = ""; + role_ = 0; + if (contentBuilder_ == null) { + content_ = java.util.Collections.emptyList(); + } else { + content_ = null; + contentBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Message_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.Message getDefaultInstanceForType() { + return io.a2a.grpc.Message.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.Message build() { + io.a2a.grpc.Message result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.Message buildPartial() { + io.a2a.grpc.Message result = new io.a2a.grpc.Message(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.a2a.grpc.Message result) { + if (contentBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + content_ = java.util.Collections.unmodifiableList(content_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.content_ = content_; + } else { + result.content_ = contentBuilder_.build(); + } + } + + private void buildPartial0(io.a2a.grpc.Message result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.messageId_ = messageId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contextId_ = contextId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.taskId_ = taskId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.role_ = role_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.metadata_ = metadataBuilder_ == null + ? metadata_ + : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + extensions_.makeImmutable(); + result.extensions_ = extensions_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.Message) { + return mergeFrom((io.a2a.grpc.Message)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.Message other) { + if (other == io.a2a.grpc.Message.getDefaultInstance()) return this; + if (!other.getMessageId().isEmpty()) { + messageId_ = other.messageId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContextId().isEmpty()) { + contextId_ = other.contextId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTaskId().isEmpty()) { + taskId_ = other.taskId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.role_ != 0) { + setRoleValue(other.getRoleValue()); + } + if (contentBuilder_ == null) { + if (!other.content_.isEmpty()) { + if (content_.isEmpty()) { + content_ = other.content_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureContentIsMutable(); + content_.addAll(other.content_); + } + onChanged(); + } + } else { + if (!other.content_.isEmpty()) { + if (contentBuilder_.isEmpty()) { + contentBuilder_.dispose(); + contentBuilder_ = null; + content_ = other.content_; + bitField0_ = (bitField0_ & ~0x00000010); + contentBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetContentFieldBuilder() : null; + } else { + contentBuilder_.addAllMessages(other.content_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.extensions_.isEmpty()) { + if (extensions_.isEmpty()) { + extensions_ = other.extensions_; + bitField0_ |= 0x00000040; + } else { + ensureExtensionsIsMutable(); + extensions_.addAll(other.extensions_); + } + 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: { + messageId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + contextId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + taskId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + role_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + io.a2a.grpc.Part m = + input.readMessage( + io.a2a.grpc.Part.parser(), + extensionRegistry); + if (contentBuilder_ == null) { + ensureContentIsMutable(); + content_.add(m); + } else { + contentBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + ensureExtensionsIsMutable(); + extensions_.add(s); + 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 messageId_ = ""; + /** + *
+     * The message id of the message. This is required and created by the
+     * message creator.
+     * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return The messageId. + */ + public java.lang.String getMessageId() { + java.lang.Object ref = messageId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + messageId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The message id of the message. This is required and created by the
+     * message creator.
+     * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return The bytes for messageId. + */ + public com.google.protobuf.ByteString + getMessageIdBytes() { + java.lang.Object ref = messageId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + messageId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The message id of the message. This is required and created by the
+     * message creator.
+     * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @param value The messageId to set. + * @return This builder for chaining. + */ + public Builder setMessageId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + messageId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The message id of the message. This is required and created by the
+     * message creator.
+     * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return This builder for chaining. + */ + public Builder clearMessageId() { + messageId_ = getDefaultInstance().getMessageId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The message id of the message. This is required and created by the
+     * message creator.
+     * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @param value The bytes for messageId to set. + * @return This builder for chaining. + */ + public Builder setMessageIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + messageId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contextId_ = ""; + /** + *
+     * The context id of the message. This is optional and if set, the message
+     * will be associated with the given context.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contextId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The context id of the message. This is optional and if set, the message
+     * will be associated with the given context.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The context id of the message. This is optional and if set, the message
+     * will be associated with the given context.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The contextId to set. + * @return This builder for chaining. + */ + public Builder setContextId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The context id of the message. This is optional and if set, the message
+     * will be associated with the given context.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return This builder for chaining. + */ + public Builder clearContextId() { + contextId_ = getDefaultInstance().getContextId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The context id of the message. This is optional and if set, the message
+     * will be associated with the given context.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The bytes for contextId to set. + * @return This builder for chaining. + */ + public Builder setContextIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object taskId_ = ""; + /** + *
+     * The task id of the message. This is optional and if set, the message
+     * will be associated with the given task.
+     * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return The taskId. + */ + public java.lang.String getTaskId() { + java.lang.Object ref = taskId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The task id of the message. This is optional and if set, the message
+     * will be associated with the given task.
+     * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + public com.google.protobuf.ByteString + getTaskIdBytes() { + java.lang.Object ref = taskId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The task id of the message. This is optional and if set, the message
+     * will be associated with the given task.
+     * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @param value The taskId to set. + * @return This builder for chaining. + */ + public Builder setTaskId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + taskId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The task id of the message. This is optional and if set, the message
+     * will be associated with the given task.
+     * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return This builder for chaining. + */ + public Builder clearTaskId() { + taskId_ = getDefaultInstance().getTaskId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * The task id of the message. This is optional and if set, the message
+     * will be associated with the given task.
+     * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @param value The bytes for taskId to set. + * @return This builder for chaining. + */ + public Builder setTaskIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + taskId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int role_ = 0; + /** + *
+     * A role for the message.
+     * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override public int getRoleValue() { + return role_; + } + /** + *
+     * A role for the message.
+     * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @param value The enum numeric value on the wire for role to set. + * @return This builder for chaining. + */ + public Builder setRoleValue(int value) { + role_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * A role for the message.
+     * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return The role. + */ + @java.lang.Override + public io.a2a.grpc.Role getRole() { + io.a2a.grpc.Role result = io.a2a.grpc.Role.forNumber(role_); + return result == null ? io.a2a.grpc.Role.UNRECOGNIZED : result; + } + /** + *
+     * A role for the message.
+     * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(io.a2a.grpc.Role value) { + if (value == null) { throw new NullPointerException(); } + bitField0_ |= 0x00000008; + role_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * A role for the message.
+     * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return This builder for chaining. + */ + public Builder clearRole() { + bitField0_ = (bitField0_ & ~0x00000008); + role_ = 0; + onChanged(); + return this; + } + + private java.util.List content_ = + java.util.Collections.emptyList(); + private void ensureContentIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + content_ = new java.util.ArrayList(content_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Part, io.a2a.grpc.Part.Builder, io.a2a.grpc.PartOrBuilder> contentBuilder_; + + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public java.util.List getContentList() { + if (contentBuilder_ == null) { + return java.util.Collections.unmodifiableList(content_); + } else { + return contentBuilder_.getMessageList(); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public int getContentCount() { + if (contentBuilder_ == null) { + return content_.size(); + } else { + return contentBuilder_.getCount(); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public io.a2a.grpc.Part getContent(int index) { + if (contentBuilder_ == null) { + return content_.get(index); + } else { + return contentBuilder_.getMessage(index); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder setContent( + int index, io.a2a.grpc.Part value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentIsMutable(); + content_.set(index, value); + onChanged(); + } else { + contentBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder setContent( + int index, io.a2a.grpc.Part.Builder builderForValue) { + if (contentBuilder_ == null) { + ensureContentIsMutable(); + content_.set(index, builderForValue.build()); + onChanged(); + } else { + contentBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder addContent(io.a2a.grpc.Part value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentIsMutable(); + content_.add(value); + onChanged(); + } else { + contentBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder addContent( + int index, io.a2a.grpc.Part value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContentIsMutable(); + content_.add(index, value); + onChanged(); + } else { + contentBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder addContent( + io.a2a.grpc.Part.Builder builderForValue) { + if (contentBuilder_ == null) { + ensureContentIsMutable(); + content_.add(builderForValue.build()); + onChanged(); + } else { + contentBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder addContent( + int index, io.a2a.grpc.Part.Builder builderForValue) { + if (contentBuilder_ == null) { + ensureContentIsMutable(); + content_.add(index, builderForValue.build()); + onChanged(); + } else { + contentBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder addAllContent( + java.lang.Iterable values) { + if (contentBuilder_ == null) { + ensureContentIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, content_); + onChanged(); + } else { + contentBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder clearContent() { + if (contentBuilder_ == null) { + content_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + contentBuilder_.clear(); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public Builder removeContent(int index) { + if (contentBuilder_ == null) { + ensureContentIsMutable(); + content_.remove(index); + onChanged(); + } else { + contentBuilder_.remove(index); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public io.a2a.grpc.Part.Builder getContentBuilder( + int index) { + return internalGetContentFieldBuilder().getBuilder(index); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public io.a2a.grpc.PartOrBuilder getContentOrBuilder( + int index) { + if (contentBuilder_ == null) { + return content_.get(index); } else { + return contentBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public java.util.List + getContentOrBuilderList() { + if (contentBuilder_ != null) { + return contentBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(content_); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public io.a2a.grpc.Part.Builder addContentBuilder() { + return internalGetContentFieldBuilder().addBuilder( + io.a2a.grpc.Part.getDefaultInstance()); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public io.a2a.grpc.Part.Builder addContentBuilder( + int index) { + return internalGetContentFieldBuilder().addBuilder( + index, io.a2a.grpc.Part.getDefaultInstance()); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * Content is the container of the message content.
+     * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + public java.util.List + getContentBuilderList() { + return internalGetContentFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Part, io.a2a.grpc.Part.Builder, io.a2a.grpc.PartOrBuilder> + internalGetContentFieldBuilder() { + if (contentBuilder_ == null) { + contentBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Part, io.a2a.grpc.Part.Builder, io.a2a.grpc.PartOrBuilder>( + content_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + content_ = null; + } + return contentBuilder_; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata( + com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + metadata_ != null && + metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000020); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * Any optional metadata to provide along with the message.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private com.google.protobuf.LazyStringArrayList extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureExtensionsIsMutable() { + if (!extensions_.isModifiable()) { + extensions_ = new com.google.protobuf.LazyStringArrayList(extensions_); + } + bitField0_ |= 0x00000040; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return A list containing the extensions. + */ + public com.google.protobuf.ProtocolStringList + getExtensionsList() { + extensions_.makeImmutable(); + return extensions_; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return The count of extensions. + */ + public int getExtensionsCount() { + return extensions_.size(); + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the element to return. + * @return The extensions at the given index. + */ + public java.lang.String getExtensions(int index) { + return extensions_.get(index); + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the value to return. + * @return The bytes of the extensions at the given index. + */ + public com.google.protobuf.ByteString + getExtensionsBytes(int index) { + return extensions_.getByteString(index); + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index to set the value at. + * @param value The extensions to set. + * @return This builder for chaining. + */ + public Builder setExtensions( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExtensionsIsMutable(); + extensions_.set(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param value The extensions to add. + * @return This builder for chaining. + */ + public Builder addExtensions( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureExtensionsIsMutable(); + extensions_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param values The extensions to add. + * @return This builder for chaining. + */ + public Builder addAllExtensions( + java.lang.Iterable values) { + ensureExtensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, extensions_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return This builder for chaining. + */ + public Builder clearExtensions() { + extensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040);; + onChanged(); + return this; + } + /** + *
+     * The URIs of extensions that are present or contributed to this Message.
+     * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param value The bytes of the extensions to add. + * @return This builder for chaining. + */ + public Builder addExtensionsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureExtensionsIsMutable(); + extensions_.add(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.Message) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.Message) + private static final io.a2a.grpc.Message DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.Message(); + } + + public static io.a2a.grpc.Message getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Message 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 io.a2a.grpc.Message getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/MessageOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/MessageOrBuilder.java new file mode 100644 index 000000000..94c1947b2 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/MessageOrBuilder.java @@ -0,0 +1,217 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface MessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.Message) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The message id of the message. This is required and created by the
+   * message creator.
+   * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return The messageId. + */ + java.lang.String getMessageId(); + /** + *
+   * The message id of the message. This is required and created by the
+   * message creator.
+   * 
+ * + * string message_id = 1 [json_name = "messageId"]; + * @return The bytes for messageId. + */ + com.google.protobuf.ByteString + getMessageIdBytes(); + + /** + *
+   * The context id of the message. This is optional and if set, the message
+   * will be associated with the given context.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + java.lang.String getContextId(); + /** + *
+   * The context id of the message. This is optional and if set, the message
+   * will be associated with the given context.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + com.google.protobuf.ByteString + getContextIdBytes(); + + /** + *
+   * The task id of the message. This is optional and if set, the message
+   * will be associated with the given task.
+   * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return The taskId. + */ + java.lang.String getTaskId(); + /** + *
+   * The task id of the message. This is optional and if set, the message
+   * will be associated with the given task.
+   * 
+ * + * string task_id = 3 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + com.google.protobuf.ByteString + getTaskIdBytes(); + + /** + *
+   * A role for the message.
+   * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return The enum numeric value on the wire for role. + */ + int getRoleValue(); + /** + *
+   * A role for the message.
+   * 
+ * + * .a2a.v1.Role role = 4 [json_name = "role"]; + * @return The role. + */ + io.a2a.grpc.Role getRole(); + + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + java.util.List + getContentList(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + io.a2a.grpc.Part getContent(int index); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + int getContentCount(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + java.util.List + getContentOrBuilderList(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * Content is the container of the message content.
+   * 
+ * + * repeated .a2a.v1.Part content = 5 [json_name = "content"]; + */ + io.a2a.grpc.PartOrBuilder getContentOrBuilder( + int index); + + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * Any optional metadata to provide along with the message.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * Any optional metadata to provide along with the message.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * Any optional metadata to provide along with the message.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); + + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return A list containing the extensions. + */ + java.util.List + getExtensionsList(); + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @return The count of extensions. + */ + int getExtensionsCount(); + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the element to return. + * @return The extensions at the given index. + */ + java.lang.String getExtensions(int index); + /** + *
+   * The URIs of extensions that are present or contributed to this Message.
+   * 
+ * + * repeated string extensions = 7 [json_name = "extensions"]; + * @param index The index of the value to return. + * @return The bytes of the extensions at the given index. + */ + com.google.protobuf.ByteString + getExtensionsBytes(int index); +} diff --git a/grpc/src/main/java/io/a2a/grpc/OAuth2SecurityScheme.java b/grpc/src/main/java/io/a2a/grpc/OAuth2SecurityScheme.java new file mode 100644 index 000000000..22a91b84a --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/OAuth2SecurityScheme.java @@ -0,0 +1,771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.OAuth2SecurityScheme} + */ +@com.google.protobuf.Generated +public final class OAuth2SecurityScheme extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.OAuth2SecurityScheme) + OAuth2SecuritySchemeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + OAuth2SecurityScheme.class.getName()); + } + // Use OAuth2SecurityScheme.newBuilder() to construct. + private OAuth2SecurityScheme(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OAuth2SecurityScheme() { + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuth2SecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuth2SecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.OAuth2SecurityScheme.class, io.a2a.grpc.OAuth2SecurityScheme.Builder.class); + } + + private int bitField0_; + public static final int DESCRIPTION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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 FLOWS_FIELD_NUMBER = 2; + private io.a2a.grpc.OAuthFlows flows_; + /** + *
+   * An object containing configuration information for the flow types supported
+   * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + * @return Whether the flows field is set. + */ + @java.lang.Override + public boolean hasFlows() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * An object containing configuration information for the flow types supported
+   * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + * @return The flows. + */ + @java.lang.Override + public io.a2a.grpc.OAuthFlows getFlows() { + return flows_ == null ? io.a2a.grpc.OAuthFlows.getDefaultInstance() : flows_; + } + /** + *
+   * An object containing configuration information for the flow types supported
+   * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + @java.lang.Override + public io.a2a.grpc.OAuthFlowsOrBuilder getFlowsOrBuilder() { + return flows_ == null ? io.a2a.grpc.OAuthFlows.getDefaultInstance() : flows_; + } + + 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.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getFlows()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFlows()); + } + 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 io.a2a.grpc.OAuth2SecurityScheme)) { + return super.equals(obj); + } + io.a2a.grpc.OAuth2SecurityScheme other = (io.a2a.grpc.OAuth2SecurityScheme) obj; + + if (!getDescription() + .equals(other.getDescription())) return false; + if (hasFlows() != other.hasFlows()) return false; + if (hasFlows()) { + if (!getFlows() + .equals(other.getFlows())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasFlows()) { + hash = (37 * hash) + FLOWS_FIELD_NUMBER; + hash = (53 * hash) + getFlows().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.OAuth2SecurityScheme parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.OAuth2SecurityScheme parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.OAuth2SecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.OAuth2SecurityScheme 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.OAuth2SecurityScheme} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.OAuth2SecurityScheme) + io.a2a.grpc.OAuth2SecuritySchemeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuth2SecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuth2SecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.OAuth2SecurityScheme.class, io.a2a.grpc.OAuth2SecurityScheme.Builder.class); + } + + // Construct using io.a2a.grpc.OAuth2SecurityScheme.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetFlowsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + description_ = ""; + flows_ = null; + if (flowsBuilder_ != null) { + flowsBuilder_.dispose(); + flowsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuth2SecurityScheme_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.OAuth2SecurityScheme getDefaultInstanceForType() { + return io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.OAuth2SecurityScheme build() { + io.a2a.grpc.OAuth2SecurityScheme result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.OAuth2SecurityScheme buildPartial() { + io.a2a.grpc.OAuth2SecurityScheme result = new io.a2a.grpc.OAuth2SecurityScheme(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.OAuth2SecurityScheme result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.flows_ = flowsBuilder_ == null + ? flows_ + : flowsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.OAuth2SecurityScheme) { + return mergeFrom((io.a2a.grpc.OAuth2SecurityScheme)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.OAuth2SecurityScheme other) { + if (other == io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFlows()) { + mergeFlows(other.getFlows()); + } + 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: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetFlowsFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 description_ = ""; + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private io.a2a.grpc.OAuthFlows flows_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OAuthFlows, io.a2a.grpc.OAuthFlows.Builder, io.a2a.grpc.OAuthFlowsOrBuilder> flowsBuilder_; + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + * @return Whether the flows field is set. + */ + public boolean hasFlows() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + * @return The flows. + */ + public io.a2a.grpc.OAuthFlows getFlows() { + if (flowsBuilder_ == null) { + return flows_ == null ? io.a2a.grpc.OAuthFlows.getDefaultInstance() : flows_; + } else { + return flowsBuilder_.getMessage(); + } + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + public Builder setFlows(io.a2a.grpc.OAuthFlows value) { + if (flowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flows_ = value; + } else { + flowsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + public Builder setFlows( + io.a2a.grpc.OAuthFlows.Builder builderForValue) { + if (flowsBuilder_ == null) { + flows_ = builderForValue.build(); + } else { + flowsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + public Builder mergeFlows(io.a2a.grpc.OAuthFlows value) { + if (flowsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + flows_ != null && + flows_ != io.a2a.grpc.OAuthFlows.getDefaultInstance()) { + getFlowsBuilder().mergeFrom(value); + } else { + flows_ = value; + } + } else { + flowsBuilder_.mergeFrom(value); + } + if (flows_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + public Builder clearFlows() { + bitField0_ = (bitField0_ & ~0x00000002); + flows_ = null; + if (flowsBuilder_ != null) { + flowsBuilder_.dispose(); + flowsBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + public io.a2a.grpc.OAuthFlows.Builder getFlowsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetFlowsFieldBuilder().getBuilder(); + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + public io.a2a.grpc.OAuthFlowsOrBuilder getFlowsOrBuilder() { + if (flowsBuilder_ != null) { + return flowsBuilder_.getMessageOrBuilder(); + } else { + return flows_ == null ? + io.a2a.grpc.OAuthFlows.getDefaultInstance() : flows_; + } + } + /** + *
+     * An object containing configuration information for the flow types supported
+     * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OAuthFlows, io.a2a.grpc.OAuthFlows.Builder, io.a2a.grpc.OAuthFlowsOrBuilder> + internalGetFlowsFieldBuilder() { + if (flowsBuilder_ == null) { + flowsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OAuthFlows, io.a2a.grpc.OAuthFlows.Builder, io.a2a.grpc.OAuthFlowsOrBuilder>( + getFlows(), + getParentForChildren(), + isClean()); + flows_ = null; + } + return flowsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.OAuth2SecurityScheme) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.OAuth2SecurityScheme) + private static final io.a2a.grpc.OAuth2SecurityScheme DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.OAuth2SecurityScheme(); + } + + public static io.a2a.grpc.OAuth2SecurityScheme getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OAuth2SecurityScheme 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 io.a2a.grpc.OAuth2SecurityScheme getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/OAuth2SecuritySchemeOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/OAuth2SecuritySchemeOrBuilder.java new file mode 100644 index 000000000..40048a192 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/OAuth2SecuritySchemeOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface OAuth2SecuritySchemeOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.OAuth2SecurityScheme) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * An object containing configuration information for the flow types supported
+   * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + * @return Whether the flows field is set. + */ + boolean hasFlows(); + /** + *
+   * An object containing configuration information for the flow types supported
+   * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + * @return The flows. + */ + io.a2a.grpc.OAuthFlows getFlows(); + /** + *
+   * An object containing configuration information for the flow types supported
+   * 
+ * + * .a2a.v1.OAuthFlows flows = 2 [json_name = "flows"]; + */ + io.a2a.grpc.OAuthFlowsOrBuilder getFlowsOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/OAuthFlows.java b/grpc/src/main/java/io/a2a/grpc/OAuthFlows.java new file mode 100644 index 000000000..5d5927d17 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/OAuthFlows.java @@ -0,0 +1,1273 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.OAuthFlows} + */ +@com.google.protobuf.Generated +public final class OAuthFlows extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.OAuthFlows) + OAuthFlowsOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + OAuthFlows.class.getName()); + } + // Use OAuthFlows.newBuilder() to construct. + private OAuthFlows(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OAuthFlows() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuthFlows_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuthFlows_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.OAuthFlows.class, io.a2a.grpc.OAuthFlows.Builder.class); + } + + private int flowCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object flow_; + public enum FlowCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTHORIZATION_CODE(1), + CLIENT_CREDENTIALS(2), + IMPLICIT(3), + PASSWORD(4), + FLOW_NOT_SET(0); + private final int value; + private FlowCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FlowCase valueOf(int value) { + return forNumber(value); + } + + public static FlowCase forNumber(int value) { + switch (value) { + case 1: return AUTHORIZATION_CODE; + case 2: return CLIENT_CREDENTIALS; + case 3: return IMPLICIT; + case 4: return PASSWORD; + case 0: return FLOW_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public FlowCase + getFlowCase() { + return FlowCase.forNumber( + flowCase_); + } + + public static final int AUTHORIZATION_CODE_FIELD_NUMBER = 1; + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + * @return Whether the authorizationCode field is set. + */ + @java.lang.Override + public boolean hasAuthorizationCode() { + return flowCase_ == 1; + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + * @return The authorizationCode. + */ + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlow getAuthorizationCode() { + if (flowCase_ == 1) { + return (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_; + } + return io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder getAuthorizationCodeOrBuilder() { + if (flowCase_ == 1) { + return (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_; + } + return io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } + + public static final int CLIENT_CREDENTIALS_FIELD_NUMBER = 2; + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + * @return Whether the clientCredentials field is set. + */ + @java.lang.Override + public boolean hasClientCredentials() { + return flowCase_ == 2; + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + * @return The clientCredentials. + */ + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlow getClientCredentials() { + if (flowCase_ == 2) { + return (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_; + } + return io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder getClientCredentialsOrBuilder() { + if (flowCase_ == 2) { + return (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_; + } + return io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } + + public static final int IMPLICIT_FIELD_NUMBER = 3; + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + * @return Whether the implicit field is set. + */ + @java.lang.Override + public boolean hasImplicit() { + return flowCase_ == 3; + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + * @return The implicit. + */ + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlow getImplicit() { + if (flowCase_ == 3) { + return (io.a2a.grpc.ImplicitOAuthFlow) flow_; + } + return io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlowOrBuilder getImplicitOrBuilder() { + if (flowCase_ == 3) { + return (io.a2a.grpc.ImplicitOAuthFlow) flow_; + } + return io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } + + public static final int PASSWORD_FIELD_NUMBER = 4; + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + * @return Whether the password field is set. + */ + @java.lang.Override + public boolean hasPassword() { + return flowCase_ == 4; + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + * @return The password. + */ + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlow getPassword() { + if (flowCase_ == 4) { + return (io.a2a.grpc.PasswordOAuthFlow) flow_; + } + return io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlowOrBuilder getPasswordOrBuilder() { + if (flowCase_ == 4) { + return (io.a2a.grpc.PasswordOAuthFlow) flow_; + } + return io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } + + 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 (flowCase_ == 1) { + output.writeMessage(1, (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_); + } + if (flowCase_ == 2) { + output.writeMessage(2, (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_); + } + if (flowCase_ == 3) { + output.writeMessage(3, (io.a2a.grpc.ImplicitOAuthFlow) flow_); + } + if (flowCase_ == 4) { + output.writeMessage(4, (io.a2a.grpc.PasswordOAuthFlow) flow_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (flowCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_); + } + if (flowCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_); + } + if (flowCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (io.a2a.grpc.ImplicitOAuthFlow) flow_); + } + if (flowCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (io.a2a.grpc.PasswordOAuthFlow) flow_); + } + 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 io.a2a.grpc.OAuthFlows)) { + return super.equals(obj); + } + io.a2a.grpc.OAuthFlows other = (io.a2a.grpc.OAuthFlows) obj; + + if (!getFlowCase().equals(other.getFlowCase())) return false; + switch (flowCase_) { + case 1: + if (!getAuthorizationCode() + .equals(other.getAuthorizationCode())) return false; + break; + case 2: + if (!getClientCredentials() + .equals(other.getClientCredentials())) return false; + break; + case 3: + if (!getImplicit() + .equals(other.getImplicit())) return false; + break; + case 4: + if (!getPassword() + .equals(other.getPassword())) return false; + break; + case 0: + default: + } + 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(); + switch (flowCase_) { + case 1: + hash = (37 * hash) + AUTHORIZATION_CODE_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizationCode().hashCode(); + break; + case 2: + hash = (37 * hash) + CLIENT_CREDENTIALS_FIELD_NUMBER; + hash = (53 * hash) + getClientCredentials().hashCode(); + break; + case 3: + hash = (37 * hash) + IMPLICIT_FIELD_NUMBER; + hash = (53 * hash) + getImplicit().hashCode(); + break; + case 4: + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.OAuthFlows parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OAuthFlows parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OAuthFlows parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.OAuthFlows parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.OAuthFlows parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.OAuthFlows parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.OAuthFlows 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.OAuthFlows} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.OAuthFlows) + io.a2a.grpc.OAuthFlowsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuthFlows_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuthFlows_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.OAuthFlows.class, io.a2a.grpc.OAuthFlows.Builder.class); + } + + // Construct using io.a2a.grpc.OAuthFlows.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (authorizationCodeBuilder_ != null) { + authorizationCodeBuilder_.clear(); + } + if (clientCredentialsBuilder_ != null) { + clientCredentialsBuilder_.clear(); + } + if (implicitBuilder_ != null) { + implicitBuilder_.clear(); + } + if (passwordBuilder_ != null) { + passwordBuilder_.clear(); + } + flowCase_ = 0; + flow_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OAuthFlows_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.OAuthFlows getDefaultInstanceForType() { + return io.a2a.grpc.OAuthFlows.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.OAuthFlows build() { + io.a2a.grpc.OAuthFlows result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.OAuthFlows buildPartial() { + io.a2a.grpc.OAuthFlows result = new io.a2a.grpc.OAuthFlows(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.OAuthFlows result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(io.a2a.grpc.OAuthFlows result) { + result.flowCase_ = flowCase_; + result.flow_ = this.flow_; + if (flowCase_ == 1 && + authorizationCodeBuilder_ != null) { + result.flow_ = authorizationCodeBuilder_.build(); + } + if (flowCase_ == 2 && + clientCredentialsBuilder_ != null) { + result.flow_ = clientCredentialsBuilder_.build(); + } + if (flowCase_ == 3 && + implicitBuilder_ != null) { + result.flow_ = implicitBuilder_.build(); + } + if (flowCase_ == 4 && + passwordBuilder_ != null) { + result.flow_ = passwordBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.OAuthFlows) { + return mergeFrom((io.a2a.grpc.OAuthFlows)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.OAuthFlows other) { + if (other == io.a2a.grpc.OAuthFlows.getDefaultInstance()) return this; + switch (other.getFlowCase()) { + case AUTHORIZATION_CODE: { + mergeAuthorizationCode(other.getAuthorizationCode()); + break; + } + case CLIENT_CREDENTIALS: { + mergeClientCredentials(other.getClientCredentials()); + break; + } + case IMPLICIT: { + mergeImplicit(other.getImplicit()); + break; + } + case PASSWORD: { + mergePassword(other.getPassword()); + break; + } + case FLOW_NOT_SET: { + break; + } + } + 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: { + input.readMessage( + internalGetAuthorizationCodeFieldBuilder().getBuilder(), + extensionRegistry); + flowCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetClientCredentialsFieldBuilder().getBuilder(), + extensionRegistry); + flowCase_ = 2; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetImplicitFieldBuilder().getBuilder(), + extensionRegistry); + flowCase_ = 3; + break; + } // case 26 + case 34: { + input.readMessage( + internalGetPasswordFieldBuilder().getBuilder(), + extensionRegistry); + flowCase_ = 4; + break; + } // case 34 + 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 flowCase_ = 0; + private java.lang.Object flow_; + public FlowCase + getFlowCase() { + return FlowCase.forNumber( + flowCase_); + } + + public Builder clearFlow() { + flowCase_ = 0; + flow_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AuthorizationCodeOAuthFlow, io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder, io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder> authorizationCodeBuilder_; + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + * @return Whether the authorizationCode field is set. + */ + @java.lang.Override + public boolean hasAuthorizationCode() { + return flowCase_ == 1; + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + * @return The authorizationCode. + */ + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlow getAuthorizationCode() { + if (authorizationCodeBuilder_ == null) { + if (flowCase_ == 1) { + return (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_; + } + return io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } else { + if (flowCase_ == 1) { + return authorizationCodeBuilder_.getMessage(); + } + return io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + public Builder setAuthorizationCode(io.a2a.grpc.AuthorizationCodeOAuthFlow value) { + if (authorizationCodeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flow_ = value; + onChanged(); + } else { + authorizationCodeBuilder_.setMessage(value); + } + flowCase_ = 1; + return this; + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + public Builder setAuthorizationCode( + io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder builderForValue) { + if (authorizationCodeBuilder_ == null) { + flow_ = builderForValue.build(); + onChanged(); + } else { + authorizationCodeBuilder_.setMessage(builderForValue.build()); + } + flowCase_ = 1; + return this; + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + public Builder mergeAuthorizationCode(io.a2a.grpc.AuthorizationCodeOAuthFlow value) { + if (authorizationCodeBuilder_ == null) { + if (flowCase_ == 1 && + flow_ != io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance()) { + flow_ = io.a2a.grpc.AuthorizationCodeOAuthFlow.newBuilder((io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_) + .mergeFrom(value).buildPartial(); + } else { + flow_ = value; + } + onChanged(); + } else { + if (flowCase_ == 1) { + authorizationCodeBuilder_.mergeFrom(value); + } else { + authorizationCodeBuilder_.setMessage(value); + } + } + flowCase_ = 1; + return this; + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + public Builder clearAuthorizationCode() { + if (authorizationCodeBuilder_ == null) { + if (flowCase_ == 1) { + flowCase_ = 0; + flow_ = null; + onChanged(); + } + } else { + if (flowCase_ == 1) { + flowCase_ = 0; + flow_ = null; + } + authorizationCodeBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + public io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder getAuthorizationCodeBuilder() { + return internalGetAuthorizationCodeFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + @java.lang.Override + public io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder getAuthorizationCodeOrBuilder() { + if ((flowCase_ == 1) && (authorizationCodeBuilder_ != null)) { + return authorizationCodeBuilder_.getMessageOrBuilder(); + } else { + if (flowCase_ == 1) { + return (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_; + } + return io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AuthorizationCodeOAuthFlow, io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder, io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder> + internalGetAuthorizationCodeFieldBuilder() { + if (authorizationCodeBuilder_ == null) { + if (!(flowCase_ == 1)) { + flow_ = io.a2a.grpc.AuthorizationCodeOAuthFlow.getDefaultInstance(); + } + authorizationCodeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AuthorizationCodeOAuthFlow, io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder, io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder>( + (io.a2a.grpc.AuthorizationCodeOAuthFlow) flow_, + getParentForChildren(), + isClean()); + flow_ = null; + } + flowCase_ = 1; + onChanged(); + return authorizationCodeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.ClientCredentialsOAuthFlow, io.a2a.grpc.ClientCredentialsOAuthFlow.Builder, io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder> clientCredentialsBuilder_; + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + * @return Whether the clientCredentials field is set. + */ + @java.lang.Override + public boolean hasClientCredentials() { + return flowCase_ == 2; + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + * @return The clientCredentials. + */ + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlow getClientCredentials() { + if (clientCredentialsBuilder_ == null) { + if (flowCase_ == 2) { + return (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_; + } + return io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } else { + if (flowCase_ == 2) { + return clientCredentialsBuilder_.getMessage(); + } + return io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + public Builder setClientCredentials(io.a2a.grpc.ClientCredentialsOAuthFlow value) { + if (clientCredentialsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flow_ = value; + onChanged(); + } else { + clientCredentialsBuilder_.setMessage(value); + } + flowCase_ = 2; + return this; + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + public Builder setClientCredentials( + io.a2a.grpc.ClientCredentialsOAuthFlow.Builder builderForValue) { + if (clientCredentialsBuilder_ == null) { + flow_ = builderForValue.build(); + onChanged(); + } else { + clientCredentialsBuilder_.setMessage(builderForValue.build()); + } + flowCase_ = 2; + return this; + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + public Builder mergeClientCredentials(io.a2a.grpc.ClientCredentialsOAuthFlow value) { + if (clientCredentialsBuilder_ == null) { + if (flowCase_ == 2 && + flow_ != io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance()) { + flow_ = io.a2a.grpc.ClientCredentialsOAuthFlow.newBuilder((io.a2a.grpc.ClientCredentialsOAuthFlow) flow_) + .mergeFrom(value).buildPartial(); + } else { + flow_ = value; + } + onChanged(); + } else { + if (flowCase_ == 2) { + clientCredentialsBuilder_.mergeFrom(value); + } else { + clientCredentialsBuilder_.setMessage(value); + } + } + flowCase_ = 2; + return this; + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + public Builder clearClientCredentials() { + if (clientCredentialsBuilder_ == null) { + if (flowCase_ == 2) { + flowCase_ = 0; + flow_ = null; + onChanged(); + } + } else { + if (flowCase_ == 2) { + flowCase_ = 0; + flow_ = null; + } + clientCredentialsBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + public io.a2a.grpc.ClientCredentialsOAuthFlow.Builder getClientCredentialsBuilder() { + return internalGetClientCredentialsFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + @java.lang.Override + public io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder getClientCredentialsOrBuilder() { + if ((flowCase_ == 2) && (clientCredentialsBuilder_ != null)) { + return clientCredentialsBuilder_.getMessageOrBuilder(); + } else { + if (flowCase_ == 2) { + return (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_; + } + return io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.ClientCredentialsOAuthFlow, io.a2a.grpc.ClientCredentialsOAuthFlow.Builder, io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder> + internalGetClientCredentialsFieldBuilder() { + if (clientCredentialsBuilder_ == null) { + if (!(flowCase_ == 2)) { + flow_ = io.a2a.grpc.ClientCredentialsOAuthFlow.getDefaultInstance(); + } + clientCredentialsBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.ClientCredentialsOAuthFlow, io.a2a.grpc.ClientCredentialsOAuthFlow.Builder, io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder>( + (io.a2a.grpc.ClientCredentialsOAuthFlow) flow_, + getParentForChildren(), + isClean()); + flow_ = null; + } + flowCase_ = 2; + onChanged(); + return clientCredentialsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.ImplicitOAuthFlow, io.a2a.grpc.ImplicitOAuthFlow.Builder, io.a2a.grpc.ImplicitOAuthFlowOrBuilder> implicitBuilder_; + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + * @return Whether the implicit field is set. + */ + @java.lang.Override + public boolean hasImplicit() { + return flowCase_ == 3; + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + * @return The implicit. + */ + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlow getImplicit() { + if (implicitBuilder_ == null) { + if (flowCase_ == 3) { + return (io.a2a.grpc.ImplicitOAuthFlow) flow_; + } + return io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } else { + if (flowCase_ == 3) { + return implicitBuilder_.getMessage(); + } + return io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + public Builder setImplicit(io.a2a.grpc.ImplicitOAuthFlow value) { + if (implicitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flow_ = value; + onChanged(); + } else { + implicitBuilder_.setMessage(value); + } + flowCase_ = 3; + return this; + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + public Builder setImplicit( + io.a2a.grpc.ImplicitOAuthFlow.Builder builderForValue) { + if (implicitBuilder_ == null) { + flow_ = builderForValue.build(); + onChanged(); + } else { + implicitBuilder_.setMessage(builderForValue.build()); + } + flowCase_ = 3; + return this; + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + public Builder mergeImplicit(io.a2a.grpc.ImplicitOAuthFlow value) { + if (implicitBuilder_ == null) { + if (flowCase_ == 3 && + flow_ != io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance()) { + flow_ = io.a2a.grpc.ImplicitOAuthFlow.newBuilder((io.a2a.grpc.ImplicitOAuthFlow) flow_) + .mergeFrom(value).buildPartial(); + } else { + flow_ = value; + } + onChanged(); + } else { + if (flowCase_ == 3) { + implicitBuilder_.mergeFrom(value); + } else { + implicitBuilder_.setMessage(value); + } + } + flowCase_ = 3; + return this; + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + public Builder clearImplicit() { + if (implicitBuilder_ == null) { + if (flowCase_ == 3) { + flowCase_ = 0; + flow_ = null; + onChanged(); + } + } else { + if (flowCase_ == 3) { + flowCase_ = 0; + flow_ = null; + } + implicitBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + public io.a2a.grpc.ImplicitOAuthFlow.Builder getImplicitBuilder() { + return internalGetImplicitFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + @java.lang.Override + public io.a2a.grpc.ImplicitOAuthFlowOrBuilder getImplicitOrBuilder() { + if ((flowCase_ == 3) && (implicitBuilder_ != null)) { + return implicitBuilder_.getMessageOrBuilder(); + } else { + if (flowCase_ == 3) { + return (io.a2a.grpc.ImplicitOAuthFlow) flow_; + } + return io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.ImplicitOAuthFlow, io.a2a.grpc.ImplicitOAuthFlow.Builder, io.a2a.grpc.ImplicitOAuthFlowOrBuilder> + internalGetImplicitFieldBuilder() { + if (implicitBuilder_ == null) { + if (!(flowCase_ == 3)) { + flow_ = io.a2a.grpc.ImplicitOAuthFlow.getDefaultInstance(); + } + implicitBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.ImplicitOAuthFlow, io.a2a.grpc.ImplicitOAuthFlow.Builder, io.a2a.grpc.ImplicitOAuthFlowOrBuilder>( + (io.a2a.grpc.ImplicitOAuthFlow) flow_, + getParentForChildren(), + isClean()); + flow_ = null; + } + flowCase_ = 3; + onChanged(); + return implicitBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PasswordOAuthFlow, io.a2a.grpc.PasswordOAuthFlow.Builder, io.a2a.grpc.PasswordOAuthFlowOrBuilder> passwordBuilder_; + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + * @return Whether the password field is set. + */ + @java.lang.Override + public boolean hasPassword() { + return flowCase_ == 4; + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + * @return The password. + */ + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlow getPassword() { + if (passwordBuilder_ == null) { + if (flowCase_ == 4) { + return (io.a2a.grpc.PasswordOAuthFlow) flow_; + } + return io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } else { + if (flowCase_ == 4) { + return passwordBuilder_.getMessage(); + } + return io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + public Builder setPassword(io.a2a.grpc.PasswordOAuthFlow value) { + if (passwordBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + flow_ = value; + onChanged(); + } else { + passwordBuilder_.setMessage(value); + } + flowCase_ = 4; + return this; + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + public Builder setPassword( + io.a2a.grpc.PasswordOAuthFlow.Builder builderForValue) { + if (passwordBuilder_ == null) { + flow_ = builderForValue.build(); + onChanged(); + } else { + passwordBuilder_.setMessage(builderForValue.build()); + } + flowCase_ = 4; + return this; + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + public Builder mergePassword(io.a2a.grpc.PasswordOAuthFlow value) { + if (passwordBuilder_ == null) { + if (flowCase_ == 4 && + flow_ != io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance()) { + flow_ = io.a2a.grpc.PasswordOAuthFlow.newBuilder((io.a2a.grpc.PasswordOAuthFlow) flow_) + .mergeFrom(value).buildPartial(); + } else { + flow_ = value; + } + onChanged(); + } else { + if (flowCase_ == 4) { + passwordBuilder_.mergeFrom(value); + } else { + passwordBuilder_.setMessage(value); + } + } + flowCase_ = 4; + return this; + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + public Builder clearPassword() { + if (passwordBuilder_ == null) { + if (flowCase_ == 4) { + flowCase_ = 0; + flow_ = null; + onChanged(); + } + } else { + if (flowCase_ == 4) { + flowCase_ = 0; + flow_ = null; + } + passwordBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + public io.a2a.grpc.PasswordOAuthFlow.Builder getPasswordBuilder() { + return internalGetPasswordFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlowOrBuilder getPasswordOrBuilder() { + if ((flowCase_ == 4) && (passwordBuilder_ != null)) { + return passwordBuilder_.getMessageOrBuilder(); + } else { + if (flowCase_ == 4) { + return (io.a2a.grpc.PasswordOAuthFlow) flow_; + } + return io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } + } + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PasswordOAuthFlow, io.a2a.grpc.PasswordOAuthFlow.Builder, io.a2a.grpc.PasswordOAuthFlowOrBuilder> + internalGetPasswordFieldBuilder() { + if (passwordBuilder_ == null) { + if (!(flowCase_ == 4)) { + flow_ = io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } + passwordBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PasswordOAuthFlow, io.a2a.grpc.PasswordOAuthFlow.Builder, io.a2a.grpc.PasswordOAuthFlowOrBuilder>( + (io.a2a.grpc.PasswordOAuthFlow) flow_, + getParentForChildren(), + isClean()); + flow_ = null; + } + flowCase_ = 4; + onChanged(); + return passwordBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.OAuthFlows) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.OAuthFlows) + private static final io.a2a.grpc.OAuthFlows DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.OAuthFlows(); + } + + public static io.a2a.grpc.OAuthFlows getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OAuthFlows 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 io.a2a.grpc.OAuthFlows getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/OAuthFlowsOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/OAuthFlowsOrBuilder.java new file mode 100644 index 000000000..a8ecd460b --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/OAuthFlowsOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface OAuthFlowsOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.OAuthFlows) + com.google.protobuf.MessageOrBuilder { + + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + * @return Whether the authorizationCode field is set. + */ + boolean hasAuthorizationCode(); + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + * @return The authorizationCode. + */ + io.a2a.grpc.AuthorizationCodeOAuthFlow getAuthorizationCode(); + /** + * .a2a.v1.AuthorizationCodeOAuthFlow authorization_code = 1 [json_name = "authorizationCode"]; + */ + io.a2a.grpc.AuthorizationCodeOAuthFlowOrBuilder getAuthorizationCodeOrBuilder(); + + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + * @return Whether the clientCredentials field is set. + */ + boolean hasClientCredentials(); + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + * @return The clientCredentials. + */ + io.a2a.grpc.ClientCredentialsOAuthFlow getClientCredentials(); + /** + * .a2a.v1.ClientCredentialsOAuthFlow client_credentials = 2 [json_name = "clientCredentials"]; + */ + io.a2a.grpc.ClientCredentialsOAuthFlowOrBuilder getClientCredentialsOrBuilder(); + + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + * @return Whether the implicit field is set. + */ + boolean hasImplicit(); + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + * @return The implicit. + */ + io.a2a.grpc.ImplicitOAuthFlow getImplicit(); + /** + * .a2a.v1.ImplicitOAuthFlow implicit = 3 [json_name = "implicit"]; + */ + io.a2a.grpc.ImplicitOAuthFlowOrBuilder getImplicitOrBuilder(); + + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + * @return Whether the password field is set. + */ + boolean hasPassword(); + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + * @return The password. + */ + io.a2a.grpc.PasswordOAuthFlow getPassword(); + /** + * .a2a.v1.PasswordOAuthFlow password = 4 [json_name = "password"]; + */ + io.a2a.grpc.PasswordOAuthFlowOrBuilder getPasswordOrBuilder(); + + io.a2a.grpc.OAuthFlows.FlowCase getFlowCase(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/OpenIdConnectSecurityScheme.java b/grpc/src/main/java/io/a2a/grpc/OpenIdConnectSecurityScheme.java new file mode 100644 index 000000000..f06f91dd9 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/OpenIdConnectSecurityScheme.java @@ -0,0 +1,701 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.OpenIdConnectSecurityScheme} + */ +@com.google.protobuf.Generated +public final class OpenIdConnectSecurityScheme extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.OpenIdConnectSecurityScheme) + OpenIdConnectSecuritySchemeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + OpenIdConnectSecurityScheme.class.getName()); + } + // Use OpenIdConnectSecurityScheme.newBuilder() to construct. + private OpenIdConnectSecurityScheme(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private OpenIdConnectSecurityScheme() { + description_ = ""; + openIdConnectUrl_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OpenIdConnectSecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OpenIdConnectSecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.OpenIdConnectSecurityScheme.class, io.a2a.grpc.OpenIdConnectSecurityScheme.Builder.class); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @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 OPEN_ID_CONNECT_URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object openIdConnectUrl_ = ""; + /** + *
+   * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+   * metadata.
+   * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return The openIdConnectUrl. + */ + @java.lang.Override + public java.lang.String getOpenIdConnectUrl() { + java.lang.Object ref = openIdConnectUrl_; + 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(); + openIdConnectUrl_ = s; + return s; + } + } + /** + *
+   * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+   * metadata.
+   * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return The bytes for openIdConnectUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOpenIdConnectUrlBytes() { + java.lang.Object ref = openIdConnectUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + openIdConnectUrl_ = 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.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(openIdConnectUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, openIdConnectUrl_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(openIdConnectUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, openIdConnectUrl_); + } + 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 io.a2a.grpc.OpenIdConnectSecurityScheme)) { + return super.equals(obj); + } + io.a2a.grpc.OpenIdConnectSecurityScheme other = (io.a2a.grpc.OpenIdConnectSecurityScheme) obj; + + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getOpenIdConnectUrl() + .equals(other.getOpenIdConnectUrl())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + OPEN_ID_CONNECT_URL_FIELD_NUMBER; + hash = (53 * hash) + getOpenIdConnectUrl().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.OpenIdConnectSecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.OpenIdConnectSecurityScheme 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.OpenIdConnectSecurityScheme} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.OpenIdConnectSecurityScheme) + io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OpenIdConnectSecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OpenIdConnectSecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.OpenIdConnectSecurityScheme.class, io.a2a.grpc.OpenIdConnectSecurityScheme.Builder.class); + } + + // Construct using io.a2a.grpc.OpenIdConnectSecurityScheme.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + description_ = ""; + openIdConnectUrl_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_OpenIdConnectSecurityScheme_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecurityScheme getDefaultInstanceForType() { + return io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecurityScheme build() { + io.a2a.grpc.OpenIdConnectSecurityScheme result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecurityScheme buildPartial() { + io.a2a.grpc.OpenIdConnectSecurityScheme result = new io.a2a.grpc.OpenIdConnectSecurityScheme(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.OpenIdConnectSecurityScheme result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.openIdConnectUrl_ = openIdConnectUrl_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.OpenIdConnectSecurityScheme) { + return mergeFrom((io.a2a.grpc.OpenIdConnectSecurityScheme)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.OpenIdConnectSecurityScheme other) { + if (other == io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getOpenIdConnectUrl().isEmpty()) { + openIdConnectUrl_ = other.openIdConnectUrl_; + bitField0_ |= 0x00000002; + 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: { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + openIdConnectUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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 description_ = ""; + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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; + } + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Description of this security scheme.
+     * 
+ * + * string description = 1 [json_name = "description"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object openIdConnectUrl_ = ""; + /** + *
+     * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+     * metadata.
+     * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return The openIdConnectUrl. + */ + public java.lang.String getOpenIdConnectUrl() { + java.lang.Object ref = openIdConnectUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + openIdConnectUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+     * metadata.
+     * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return The bytes for openIdConnectUrl. + */ + public com.google.protobuf.ByteString + getOpenIdConnectUrlBytes() { + java.lang.Object ref = openIdConnectUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + openIdConnectUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+     * metadata.
+     * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @param value The openIdConnectUrl to set. + * @return This builder for chaining. + */ + public Builder setOpenIdConnectUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + openIdConnectUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+     * metadata.
+     * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return This builder for chaining. + */ + public Builder clearOpenIdConnectUrl() { + openIdConnectUrl_ = getDefaultInstance().getOpenIdConnectUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+     * metadata.
+     * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @param value The bytes for openIdConnectUrl to set. + * @return This builder for chaining. + */ + public Builder setOpenIdConnectUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + openIdConnectUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.OpenIdConnectSecurityScheme) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.OpenIdConnectSecurityScheme) + private static final io.a2a.grpc.OpenIdConnectSecurityScheme DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.OpenIdConnectSecurityScheme(); + } + + public static io.a2a.grpc.OpenIdConnectSecurityScheme getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OpenIdConnectSecurityScheme 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 io.a2a.grpc.OpenIdConnectSecurityScheme getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/OpenIdConnectSecuritySchemeOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/OpenIdConnectSecuritySchemeOrBuilder.java new file mode 100644 index 000000000..0682b5f93 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/OpenIdConnectSecuritySchemeOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface OpenIdConnectSecuritySchemeOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.OpenIdConnectSecurityScheme) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * Description of this security scheme.
+   * 
+ * + * string description = 1 [json_name = "description"]; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+   * metadata.
+   * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return The openIdConnectUrl. + */ + java.lang.String getOpenIdConnectUrl(); + /** + *
+   * Well-known URL to discover the [[OpenID-Connect-Discovery]] provider
+   * metadata.
+   * 
+ * + * string open_id_connect_url = 2 [json_name = "openIdConnectUrl"]; + * @return The bytes for openIdConnectUrl. + */ + com.google.protobuf.ByteString + getOpenIdConnectUrlBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/Part.java b/grpc/src/main/java/io/a2a/grpc/Part.java new file mode 100644 index 000000000..5582d8d5e --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/Part.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Part represents a container for a section of communication content.
+ * Parts can be purely textual, some sort of file (image, video, etc) or
+ * a structured data blob (i.e. JSON).
+ * 
+ * + * Protobuf type {@code a2a.v1.Part} + */ +@com.google.protobuf.Generated +public final class Part extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.Part) + PartOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + Part.class.getName()); + } + // Use Part.newBuilder() to construct. + private Part(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Part() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Part.class, io.a2a.grpc.Part.Builder.class); + } + + private int partCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object part_; + public enum PartCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(1), + FILE(2), + DATA(3), + PART_NOT_SET(0); + private final int value; + private PartCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PartCase valueOf(int value) { + return forNumber(value); + } + + public static PartCase forNumber(int value) { + switch (value) { + case 1: return TEXT; + case 2: return FILE; + case 3: return DATA; + case 0: return PART_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public PartCase + getPartCase() { + return PartCase.forNumber( + partCase_); + } + + public static final int TEXT_FIELD_NUMBER = 1; + /** + * string text = 1 [json_name = "text"]; + * @return Whether the text field is set. + */ + public boolean hasText() { + return partCase_ == 1; + } + /** + * string text = 1 [json_name = "text"]; + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (partCase_ == 1) { + ref = part_; + } + 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(); + if (partCase_ == 1) { + part_ = s; + } + return s; + } + } + /** + * string text = 1 [json_name = "text"]; + * @return The bytes for text. + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = ""; + if (partCase_ == 1) { + ref = part_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (partCase_ == 1) { + part_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_FIELD_NUMBER = 2; + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + * @return Whether the file field is set. + */ + @java.lang.Override + public boolean hasFile() { + return partCase_ == 2; + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + * @return The file. + */ + @java.lang.Override + public io.a2a.grpc.FilePart getFile() { + if (partCase_ == 2) { + return (io.a2a.grpc.FilePart) part_; + } + return io.a2a.grpc.FilePart.getDefaultInstance(); + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + @java.lang.Override + public io.a2a.grpc.FilePartOrBuilder getFileOrBuilder() { + if (partCase_ == 2) { + return (io.a2a.grpc.FilePart) part_; + } + return io.a2a.grpc.FilePart.getDefaultInstance(); + } + + public static final int DATA_FIELD_NUMBER = 3; + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return partCase_ == 3; + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public io.a2a.grpc.DataPart getData() { + if (partCase_ == 3) { + return (io.a2a.grpc.DataPart) part_; + } + return io.a2a.grpc.DataPart.getDefaultInstance(); + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + @java.lang.Override + public io.a2a.grpc.DataPartOrBuilder getDataOrBuilder() { + if (partCase_ == 3) { + return (io.a2a.grpc.DataPart) part_; + } + return io.a2a.grpc.DataPart.getDefaultInstance(); + } + + 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 (partCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, part_); + } + if (partCase_ == 2) { + output.writeMessage(2, (io.a2a.grpc.FilePart) part_); + } + if (partCase_ == 3) { + output.writeMessage(3, (io.a2a.grpc.DataPart) part_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (partCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, part_); + } + if (partCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (io.a2a.grpc.FilePart) part_); + } + if (partCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (io.a2a.grpc.DataPart) part_); + } + 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 io.a2a.grpc.Part)) { + return super.equals(obj); + } + io.a2a.grpc.Part other = (io.a2a.grpc.Part) obj; + + if (!getPartCase().equals(other.getPartCase())) return false; + switch (partCase_) { + case 1: + if (!getText() + .equals(other.getText())) return false; + break; + case 2: + if (!getFile() + .equals(other.getFile())) return false; + break; + case 3: + if (!getData() + .equals(other.getData())) return false; + break; + case 0: + default: + } + 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(); + switch (partCase_) { + case 1: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 2: + hash = (37 * hash) + FILE_FIELD_NUMBER; + hash = (53 * hash) + getFile().hashCode(); + break; + case 3: + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.Part parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Part parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Part parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Part parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Part parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Part parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Part parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Part parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.Part parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.Part parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.Part parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Part parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.Part 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Part represents a container for a section of communication content.
+   * Parts can be purely textual, some sort of file (image, video, etc) or
+   * a structured data blob (i.e. JSON).
+   * 
+ * + * Protobuf type {@code a2a.v1.Part} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.Part) + io.a2a.grpc.PartOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Part_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Part_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Part.class, io.a2a.grpc.Part.Builder.class); + } + + // Construct using io.a2a.grpc.Part.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (fileBuilder_ != null) { + fileBuilder_.clear(); + } + if (dataBuilder_ != null) { + dataBuilder_.clear(); + } + partCase_ = 0; + part_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Part_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.Part getDefaultInstanceForType() { + return io.a2a.grpc.Part.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.Part build() { + io.a2a.grpc.Part result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.Part buildPartial() { + io.a2a.grpc.Part result = new io.a2a.grpc.Part(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.Part result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(io.a2a.grpc.Part result) { + result.partCase_ = partCase_; + result.part_ = this.part_; + if (partCase_ == 2 && + fileBuilder_ != null) { + result.part_ = fileBuilder_.build(); + } + if (partCase_ == 3 && + dataBuilder_ != null) { + result.part_ = dataBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.Part) { + return mergeFrom((io.a2a.grpc.Part)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.Part other) { + if (other == io.a2a.grpc.Part.getDefaultInstance()) return this; + switch (other.getPartCase()) { + case TEXT: { + partCase_ = 1; + part_ = other.part_; + onChanged(); + break; + } + case FILE: { + mergeFile(other.getFile()); + break; + } + case DATA: { + mergeData(other.getData()); + break; + } + case PART_NOT_SET: { + break; + } + } + 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: { + java.lang.String s = input.readStringRequireUtf8(); + partCase_ = 1; + part_ = s; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetFileFieldBuilder().getBuilder(), + extensionRegistry); + partCase_ = 2; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetDataFieldBuilder().getBuilder(), + extensionRegistry); + partCase_ = 3; + 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 partCase_ = 0; + private java.lang.Object part_; + public PartCase + getPartCase() { + return PartCase.forNumber( + partCase_); + } + + public Builder clearPart() { + partCase_ = 0; + part_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string text = 1 [json_name = "text"]; + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return partCase_ == 1; + } + /** + * string text = 1 [json_name = "text"]; + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (partCase_ == 1) { + ref = part_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (partCase_ == 1) { + part_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string text = 1 [json_name = "text"]; + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = ""; + if (partCase_ == 1) { + ref = part_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (partCase_ == 1) { + part_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string text = 1 [json_name = "text"]; + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + partCase_ = 1; + part_ = value; + onChanged(); + return this; + } + /** + * string text = 1 [json_name = "text"]; + * @return This builder for chaining. + */ + public Builder clearText() { + if (partCase_ == 1) { + partCase_ = 0; + part_ = null; + onChanged(); + } + return this; + } + /** + * string text = 1 [json_name = "text"]; + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + partCase_ = 1; + part_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.FilePart, io.a2a.grpc.FilePart.Builder, io.a2a.grpc.FilePartOrBuilder> fileBuilder_; + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + * @return Whether the file field is set. + */ + @java.lang.Override + public boolean hasFile() { + return partCase_ == 2; + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + * @return The file. + */ + @java.lang.Override + public io.a2a.grpc.FilePart getFile() { + if (fileBuilder_ == null) { + if (partCase_ == 2) { + return (io.a2a.grpc.FilePart) part_; + } + return io.a2a.grpc.FilePart.getDefaultInstance(); + } else { + if (partCase_ == 2) { + return fileBuilder_.getMessage(); + } + return io.a2a.grpc.FilePart.getDefaultInstance(); + } + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + public Builder setFile(io.a2a.grpc.FilePart value) { + if (fileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + part_ = value; + onChanged(); + } else { + fileBuilder_.setMessage(value); + } + partCase_ = 2; + return this; + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + public Builder setFile( + io.a2a.grpc.FilePart.Builder builderForValue) { + if (fileBuilder_ == null) { + part_ = builderForValue.build(); + onChanged(); + } else { + fileBuilder_.setMessage(builderForValue.build()); + } + partCase_ = 2; + return this; + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + public Builder mergeFile(io.a2a.grpc.FilePart value) { + if (fileBuilder_ == null) { + if (partCase_ == 2 && + part_ != io.a2a.grpc.FilePart.getDefaultInstance()) { + part_ = io.a2a.grpc.FilePart.newBuilder((io.a2a.grpc.FilePart) part_) + .mergeFrom(value).buildPartial(); + } else { + part_ = value; + } + onChanged(); + } else { + if (partCase_ == 2) { + fileBuilder_.mergeFrom(value); + } else { + fileBuilder_.setMessage(value); + } + } + partCase_ = 2; + return this; + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + public Builder clearFile() { + if (fileBuilder_ == null) { + if (partCase_ == 2) { + partCase_ = 0; + part_ = null; + onChanged(); + } + } else { + if (partCase_ == 2) { + partCase_ = 0; + part_ = null; + } + fileBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + public io.a2a.grpc.FilePart.Builder getFileBuilder() { + return internalGetFileFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + @java.lang.Override + public io.a2a.grpc.FilePartOrBuilder getFileOrBuilder() { + if ((partCase_ == 2) && (fileBuilder_ != null)) { + return fileBuilder_.getMessageOrBuilder(); + } else { + if (partCase_ == 2) { + return (io.a2a.grpc.FilePart) part_; + } + return io.a2a.grpc.FilePart.getDefaultInstance(); + } + } + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.FilePart, io.a2a.grpc.FilePart.Builder, io.a2a.grpc.FilePartOrBuilder> + internalGetFileFieldBuilder() { + if (fileBuilder_ == null) { + if (!(partCase_ == 2)) { + part_ = io.a2a.grpc.FilePart.getDefaultInstance(); + } + fileBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.FilePart, io.a2a.grpc.FilePart.Builder, io.a2a.grpc.FilePartOrBuilder>( + (io.a2a.grpc.FilePart) part_, + getParentForChildren(), + isClean()); + part_ = null; + } + partCase_ = 2; + onChanged(); + return fileBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.DataPart, io.a2a.grpc.DataPart.Builder, io.a2a.grpc.DataPartOrBuilder> dataBuilder_; + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return partCase_ == 3; + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + * @return The data. + */ + @java.lang.Override + public io.a2a.grpc.DataPart getData() { + if (dataBuilder_ == null) { + if (partCase_ == 3) { + return (io.a2a.grpc.DataPart) part_; + } + return io.a2a.grpc.DataPart.getDefaultInstance(); + } else { + if (partCase_ == 3) { + return dataBuilder_.getMessage(); + } + return io.a2a.grpc.DataPart.getDefaultInstance(); + } + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + public Builder setData(io.a2a.grpc.DataPart value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + part_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + partCase_ = 3; + return this; + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + public Builder setData( + io.a2a.grpc.DataPart.Builder builderForValue) { + if (dataBuilder_ == null) { + part_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + partCase_ = 3; + return this; + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + public Builder mergeData(io.a2a.grpc.DataPart value) { + if (dataBuilder_ == null) { + if (partCase_ == 3 && + part_ != io.a2a.grpc.DataPart.getDefaultInstance()) { + part_ = io.a2a.grpc.DataPart.newBuilder((io.a2a.grpc.DataPart) part_) + .mergeFrom(value).buildPartial(); + } else { + part_ = value; + } + onChanged(); + } else { + if (partCase_ == 3) { + dataBuilder_.mergeFrom(value); + } else { + dataBuilder_.setMessage(value); + } + } + partCase_ = 3; + return this; + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + if (partCase_ == 3) { + partCase_ = 0; + part_ = null; + onChanged(); + } + } else { + if (partCase_ == 3) { + partCase_ = 0; + part_ = null; + } + dataBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + public io.a2a.grpc.DataPart.Builder getDataBuilder() { + return internalGetDataFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + @java.lang.Override + public io.a2a.grpc.DataPartOrBuilder getDataOrBuilder() { + if ((partCase_ == 3) && (dataBuilder_ != null)) { + return dataBuilder_.getMessageOrBuilder(); + } else { + if (partCase_ == 3) { + return (io.a2a.grpc.DataPart) part_; + } + return io.a2a.grpc.DataPart.getDefaultInstance(); + } + } + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.DataPart, io.a2a.grpc.DataPart.Builder, io.a2a.grpc.DataPartOrBuilder> + internalGetDataFieldBuilder() { + if (dataBuilder_ == null) { + if (!(partCase_ == 3)) { + part_ = io.a2a.grpc.DataPart.getDefaultInstance(); + } + dataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.DataPart, io.a2a.grpc.DataPart.Builder, io.a2a.grpc.DataPartOrBuilder>( + (io.a2a.grpc.DataPart) part_, + getParentForChildren(), + isClean()); + part_ = null; + } + partCase_ = 3; + onChanged(); + return dataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.Part) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.Part) + private static final io.a2a.grpc.Part DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.Part(); + } + + public static io.a2a.grpc.Part getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Part 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 io.a2a.grpc.Part getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/PartOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/PartOrBuilder.java new file mode 100644 index 000000000..5840438a3 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/PartOrBuilder.java @@ -0,0 +1,61 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface PartOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.Part) + com.google.protobuf.MessageOrBuilder { + + /** + * string text = 1 [json_name = "text"]; + * @return Whether the text field is set. + */ + boolean hasText(); + /** + * string text = 1 [json_name = "text"]; + * @return The text. + */ + java.lang.String getText(); + /** + * string text = 1 [json_name = "text"]; + * @return The bytes for text. + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + * @return Whether the file field is set. + */ + boolean hasFile(); + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + * @return The file. + */ + io.a2a.grpc.FilePart getFile(); + /** + * .a2a.v1.FilePart file = 2 [json_name = "file"]; + */ + io.a2a.grpc.FilePartOrBuilder getFileOrBuilder(); + + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + * @return The data. + */ + io.a2a.grpc.DataPart getData(); + /** + * .a2a.v1.DataPart data = 3 [json_name = "data"]; + */ + io.a2a.grpc.DataPartOrBuilder getDataOrBuilder(); + + io.a2a.grpc.Part.PartCase getPartCase(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/PasswordOAuthFlow.java b/grpc/src/main/java/io/a2a/grpc/PasswordOAuthFlow.java new file mode 100644 index 000000000..3801ef006 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/PasswordOAuthFlow.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.PasswordOAuthFlow} + */ +@com.google.protobuf.Generated +public final class PasswordOAuthFlow extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.PasswordOAuthFlow) + PasswordOAuthFlowOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + PasswordOAuthFlow.class.getName()); + } + // Use PasswordOAuthFlow.newBuilder() to construct. + private PasswordOAuthFlow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PasswordOAuthFlow() { + tokenUrl_ = ""; + refreshUrl_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PasswordOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PasswordOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.PasswordOAuthFlow.class, io.a2a.grpc.PasswordOAuthFlow.Builder.class); + } + + public static final int TOKEN_URL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object tokenUrl_ = ""; + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + @java.lang.Override + public java.lang.String getTokenUrl() { + java.lang.Object ref = tokenUrl_; + 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(); + tokenUrl_ = s; + return s; + } + } + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTokenUrlBytes() { + java.lang.Object ref = tokenUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tokenUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFRESH_URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object refreshUrl_ = ""; + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + @java.lang.Override + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + 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(); + refreshUrl_ = s; + return s; + } + } + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCOPES_FIELD_NUMBER = 3; + private static final class ScopesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.a2a.grpc.A2A.internal_static_a2a_v1_PasswordOAuthFlow_ScopesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.GeneratedMessage.isStringEmpty(tokenUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tokenUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, refreshUrl_); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetScopes(), + ScopesDefaultEntryHolder.defaultEntry, + 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tokenUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tokenUrl_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(refreshUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, refreshUrl_); + } + for (java.util.Map.Entry entry + : internalGetScopes().getMap().entrySet()) { + com.google.protobuf.MapEntry + scopes__ = ScopesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, scopes__); + } + 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 io.a2a.grpc.PasswordOAuthFlow)) { + return super.equals(obj); + } + io.a2a.grpc.PasswordOAuthFlow other = (io.a2a.grpc.PasswordOAuthFlow) obj; + + if (!getTokenUrl() + .equals(other.getTokenUrl())) return false; + if (!getRefreshUrl() + .equals(other.getRefreshUrl())) return false; + if (!internalGetScopes().equals( + other.internalGetScopes())) 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) + TOKEN_URL_FIELD_NUMBER; + hash = (53 * hash) + getTokenUrl().hashCode(); + hash = (37 * hash) + REFRESH_URL_FIELD_NUMBER; + hash = (53 * hash) + getRefreshUrl().hashCode(); + if (!internalGetScopes().getMap().isEmpty()) { + hash = (37 * hash) + SCOPES_FIELD_NUMBER; + hash = (53 * hash) + internalGetScopes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.PasswordOAuthFlow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.PasswordOAuthFlow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.PasswordOAuthFlow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.PasswordOAuthFlow 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.PasswordOAuthFlow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.PasswordOAuthFlow) + io.a2a.grpc.PasswordOAuthFlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PasswordOAuthFlow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableScopes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PasswordOAuthFlow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.PasswordOAuthFlow.class, io.a2a.grpc.PasswordOAuthFlow.Builder.class); + } + + // Construct using io.a2a.grpc.PasswordOAuthFlow.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + tokenUrl_ = ""; + refreshUrl_ = ""; + internalGetMutableScopes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PasswordOAuthFlow_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlow getDefaultInstanceForType() { + return io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlow build() { + io.a2a.grpc.PasswordOAuthFlow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.PasswordOAuthFlow buildPartial() { + io.a2a.grpc.PasswordOAuthFlow result = new io.a2a.grpc.PasswordOAuthFlow(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.PasswordOAuthFlow result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tokenUrl_ = tokenUrl_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.refreshUrl_ = refreshUrl_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.scopes_ = internalGetScopes(); + result.scopes_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.PasswordOAuthFlow) { + return mergeFrom((io.a2a.grpc.PasswordOAuthFlow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.PasswordOAuthFlow other) { + if (other == io.a2a.grpc.PasswordOAuthFlow.getDefaultInstance()) return this; + if (!other.getTokenUrl().isEmpty()) { + tokenUrl_ = other.tokenUrl_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRefreshUrl().isEmpty()) { + refreshUrl_ = other.refreshUrl_; + bitField0_ |= 0x00000002; + onChanged(); + } + internalGetMutableScopes().mergeFrom( + other.internalGetScopes()); + bitField0_ |= 0x00000004; + 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: { + tokenUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + refreshUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + scopes__ = input.readMessage( + ScopesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableScopes().getMutableMap().put( + scopes__.getKey(), scopes__.getValue()); + bitField0_ |= 0x00000004; + 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.lang.Object tokenUrl_ = ""; + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + public java.lang.String getTokenUrl() { + java.lang.Object ref = tokenUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tokenUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + public com.google.protobuf.ByteString + getTokenUrlBytes() { + java.lang.Object ref = tokenUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + tokenUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @param value The tokenUrl to set. + * @return This builder for chaining. + */ + public Builder setTokenUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + tokenUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return This builder for chaining. + */ + public Builder clearTokenUrl() { + tokenUrl_ = getDefaultInstance().getTokenUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The token URL to be used for this flow. This MUST be in the form of a URL.
+     * The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @param value The bytes for tokenUrl to set. + * @return This builder for chaining. + */ + public Builder setTokenUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + tokenUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object refreshUrl_ = ""; + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + public java.lang.String getRefreshUrl() { + java.lang.Object ref = refreshUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refreshUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + public com.google.protobuf.ByteString + getRefreshUrlBytes() { + java.lang.Object ref = refreshUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + refreshUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @param value The refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + refreshUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return This builder for chaining. + */ + public Builder clearRefreshUrl() { + refreshUrl_ = getDefaultInstance().getRefreshUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The URL to be used for obtaining refresh tokens. This MUST be in the
+     * form of a URL. The OAuth2 standard requires the use of TLS.
+     * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @param value The bytes for refreshUrl to set. + * @return This builder for chaining. + */ + public Builder setRefreshUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + refreshUrl_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> scopes_; + private com.google.protobuf.MapField + internalGetScopes() { + if (scopes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + return scopes_; + } + private com.google.protobuf.MapField + internalGetMutableScopes() { + if (scopes_ == null) { + scopes_ = com.google.protobuf.MapField.newMapField( + ScopesDefaultEntryHolder.defaultEntry); + } + if (!scopes_.isMutable()) { + scopes_ = scopes_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return scopes_; + } + public int getScopesCount() { + return internalGetScopes().getMap().size(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public boolean containsScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetScopes().getMap().containsKey(key); + } + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getScopes() { + return getScopesMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.util.Map getScopesMap() { + return internalGetScopes().getMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + @java.lang.Override + public java.lang.String getScopesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetScopes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearScopes() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableScopes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder removeScopes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableScopes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableScopes() { + bitField0_ |= 0x00000004; + return internalGetMutableScopes().getMutableMap(); + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder putScopes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableScopes().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
+     * The available scopes for the OAuth2 security scheme. A map between the
+     * scope name and a short description for it. The map MAY be empty.
+     * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + public Builder putAllScopes( + java.util.Map values) { + internalGetMutableScopes().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.PasswordOAuthFlow) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.PasswordOAuthFlow) + private static final io.a2a.grpc.PasswordOAuthFlow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.PasswordOAuthFlow(); + } + + public static io.a2a.grpc.PasswordOAuthFlow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PasswordOAuthFlow 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 io.a2a.grpc.PasswordOAuthFlow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/PasswordOAuthFlowOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/PasswordOAuthFlowOrBuilder.java new file mode 100644 index 000000000..73c88685f --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/PasswordOAuthFlowOrBuilder.java @@ -0,0 +1,115 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface PasswordOAuthFlowOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.PasswordOAuthFlow) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The tokenUrl. + */ + java.lang.String getTokenUrl(); + /** + *
+   * The token URL to be used for this flow. This MUST be in the form of a URL.
+   * The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string token_url = 1 [json_name = "tokenUrl"]; + * @return The bytes for tokenUrl. + */ + com.google.protobuf.ByteString + getTokenUrlBytes(); + + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The refreshUrl. + */ + java.lang.String getRefreshUrl(); + /** + *
+   * The URL to be used for obtaining refresh tokens. This MUST be in the
+   * form of a URL. The OAuth2 standard requires the use of TLS.
+   * 
+ * + * string refresh_url = 2 [json_name = "refreshUrl"]; + * @return The bytes for refreshUrl. + */ + com.google.protobuf.ByteString + getRefreshUrlBytes(); + + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + int getScopesCount(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + boolean containsScopes( + java.lang.String key); + /** + * Use {@link #getScopesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getScopes(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + java.util.Map + getScopesMap(); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + /* nullable */ +java.lang.String getScopesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+   * The available scopes for the OAuth2 security scheme. A map between the
+   * scope name and a short description for it. The map MAY be empty.
+   * 
+ * + * map<string, string> scopes = 3 [json_name = "scopes"]; + */ + java.lang.String getScopesOrThrow( + java.lang.String key); +} diff --git a/grpc/src/main/java/io/a2a/grpc/PushNotificationConfig.java b/grpc/src/main/java/io/a2a/grpc/PushNotificationConfig.java new file mode 100644 index 000000000..b9b1909f5 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/PushNotificationConfig.java @@ -0,0 +1,1107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Configuration for setting up push notifications for task updates.
+ * 
+ * + * Protobuf type {@code a2a.v1.PushNotificationConfig} + */ +@com.google.protobuf.Generated +public final class PushNotificationConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.PushNotificationConfig) + PushNotificationConfigOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + PushNotificationConfig.class.getName()); + } + // Use PushNotificationConfig.newBuilder() to construct. + private PushNotificationConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PushNotificationConfig() { + id_ = ""; + url_ = ""; + token_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PushNotificationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PushNotificationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.PushNotificationConfig.class, io.a2a.grpc.PushNotificationConfig.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + *
+   * A unique id for this push notification.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + *
+   * A unique id for this push notification.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + *
+   * Url to send the notification too
+   * 
+ * + * string url = 2 [json_name = "url"]; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + 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(); + url_ = s; + return s; + } + } + /** + *
+   * Url to send the notification too
+   * 
+ * + * string url = 2 [json_name = "url"]; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOKEN_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object token_ = ""; + /** + *
+   * Token unique for this task/session
+   * 
+ * + * string token = 3 [json_name = "token"]; + * @return The token. + */ + @java.lang.Override + public java.lang.String getToken() { + java.lang.Object ref = token_; + 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(); + token_ = s; + return s; + } + } + /** + *
+   * Token unique for this task/session
+   * 
+ * + * string token = 3 [json_name = "token"]; + * @return The bytes for token. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHENTICATION_FIELD_NUMBER = 4; + private io.a2a.grpc.AuthenticationInfo authentication_; + /** + *
+   * Information about the authentication to sent with the notification
+   * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + * @return Whether the authentication field is set. + */ + @java.lang.Override + public boolean hasAuthentication() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * Information about the authentication to sent with the notification
+   * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + * @return The authentication. + */ + @java.lang.Override + public io.a2a.grpc.AuthenticationInfo getAuthentication() { + return authentication_ == null ? io.a2a.grpc.AuthenticationInfo.getDefaultInstance() : authentication_; + } + /** + *
+   * Information about the authentication to sent with the notification
+   * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + @java.lang.Override + public io.a2a.grpc.AuthenticationInfoOrBuilder getAuthenticationOrBuilder() { + return authentication_ == null ? io.a2a.grpc.AuthenticationInfo.getDefaultInstance() : authentication_; + } + + 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.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, url_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, token_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getAuthentication()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, url_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, token_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAuthentication()); + } + 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 io.a2a.grpc.PushNotificationConfig)) { + return super.equals(obj); + } + io.a2a.grpc.PushNotificationConfig other = (io.a2a.grpc.PushNotificationConfig) obj; + + if (!getId() + .equals(other.getId())) return false; + if (!getUrl() + .equals(other.getUrl())) return false; + if (!getToken() + .equals(other.getToken())) return false; + if (hasAuthentication() != other.hasAuthentication()) return false; + if (hasAuthentication()) { + if (!getAuthentication() + .equals(other.getAuthentication())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + if (hasAuthentication()) { + hash = (37 * hash) + AUTHENTICATION_FIELD_NUMBER; + hash = (53 * hash) + getAuthentication().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.PushNotificationConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.PushNotificationConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.PushNotificationConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.PushNotificationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.PushNotificationConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Configuration for setting up push notifications for task updates.
+   * 
+ * + * Protobuf type {@code a2a.v1.PushNotificationConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.PushNotificationConfig) + io.a2a.grpc.PushNotificationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PushNotificationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PushNotificationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.PushNotificationConfig.class, io.a2a.grpc.PushNotificationConfig.Builder.class); + } + + // Construct using io.a2a.grpc.PushNotificationConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetAuthenticationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + url_ = ""; + token_ = ""; + authentication_ = null; + if (authenticationBuilder_ != null) { + authenticationBuilder_.dispose(); + authenticationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_PushNotificationConfig_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.PushNotificationConfig getDefaultInstanceForType() { + return io.a2a.grpc.PushNotificationConfig.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.PushNotificationConfig build() { + io.a2a.grpc.PushNotificationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.PushNotificationConfig buildPartial() { + io.a2a.grpc.PushNotificationConfig result = new io.a2a.grpc.PushNotificationConfig(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.PushNotificationConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.url_ = url_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.token_ = token_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.authentication_ = authenticationBuilder_ == null + ? authentication_ + : authenticationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.PushNotificationConfig) { + return mergeFrom((io.a2a.grpc.PushNotificationConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.PushNotificationConfig other) { + if (other == io.a2a.grpc.PushNotificationConfig.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getToken().isEmpty()) { + token_ = other.token_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasAuthentication()) { + mergeAuthentication(other.getAuthentication()); + } + 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: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + token_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + input.readMessage( + internalGetAuthenticationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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 id_ = ""; + /** + *
+     * A unique id for this push notification.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A unique id for this push notification.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A unique id for this push notification.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * A unique id for this push notification.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * A unique id for this push notification.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+     * Url to send the notification too
+     * 
+ * + * string url = 2 [json_name = "url"]; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Url to send the notification too
+     * 
+ * + * string url = 2 [json_name = "url"]; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Url to send the notification too
+     * 
+ * + * string url = 2 [json_name = "url"]; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + url_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Url to send the notification too
+     * 
+ * + * string url = 2 [json_name = "url"]; + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Url to send the notification too
+     * 
+ * + * string url = 2 [json_name = "url"]; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object token_ = ""; + /** + *
+     * Token unique for this task/session
+     * 
+ * + * string token = 3 [json_name = "token"]; + * @return The token. + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token unique for this task/session
+     * 
+ * + * string token = 3 [json_name = "token"]; + * @return The bytes for token. + */ + public com.google.protobuf.ByteString + getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token unique for this task/session
+     * 
+ * + * string token = 3 [json_name = "token"]; + * @param value The token to set. + * @return This builder for chaining. + */ + public Builder setToken( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + token_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Token unique for this task/session
+     * 
+ * + * string token = 3 [json_name = "token"]; + * @return This builder for chaining. + */ + public Builder clearToken() { + token_ = getDefaultInstance().getToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Token unique for this task/session
+     * 
+ * + * string token = 3 [json_name = "token"]; + * @param value The bytes for token to set. + * @return This builder for chaining. + */ + public Builder setTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + token_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private io.a2a.grpc.AuthenticationInfo authentication_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AuthenticationInfo, io.a2a.grpc.AuthenticationInfo.Builder, io.a2a.grpc.AuthenticationInfoOrBuilder> authenticationBuilder_; + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + * @return Whether the authentication field is set. + */ + public boolean hasAuthentication() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + * @return The authentication. + */ + public io.a2a.grpc.AuthenticationInfo getAuthentication() { + if (authenticationBuilder_ == null) { + return authentication_ == null ? io.a2a.grpc.AuthenticationInfo.getDefaultInstance() : authentication_; + } else { + return authenticationBuilder_.getMessage(); + } + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + public Builder setAuthentication(io.a2a.grpc.AuthenticationInfo value) { + if (authenticationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authentication_ = value; + } else { + authenticationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + public Builder setAuthentication( + io.a2a.grpc.AuthenticationInfo.Builder builderForValue) { + if (authenticationBuilder_ == null) { + authentication_ = builderForValue.build(); + } else { + authenticationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + public Builder mergeAuthentication(io.a2a.grpc.AuthenticationInfo value) { + if (authenticationBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) && + authentication_ != null && + authentication_ != io.a2a.grpc.AuthenticationInfo.getDefaultInstance()) { + getAuthenticationBuilder().mergeFrom(value); + } else { + authentication_ = value; + } + } else { + authenticationBuilder_.mergeFrom(value); + } + if (authentication_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + public Builder clearAuthentication() { + bitField0_ = (bitField0_ & ~0x00000008); + authentication_ = null; + if (authenticationBuilder_ != null) { + authenticationBuilder_.dispose(); + authenticationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + public io.a2a.grpc.AuthenticationInfo.Builder getAuthenticationBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetAuthenticationFieldBuilder().getBuilder(); + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + public io.a2a.grpc.AuthenticationInfoOrBuilder getAuthenticationOrBuilder() { + if (authenticationBuilder_ != null) { + return authenticationBuilder_.getMessageOrBuilder(); + } else { + return authentication_ == null ? + io.a2a.grpc.AuthenticationInfo.getDefaultInstance() : authentication_; + } + } + /** + *
+     * Information about the authentication to sent with the notification
+     * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AuthenticationInfo, io.a2a.grpc.AuthenticationInfo.Builder, io.a2a.grpc.AuthenticationInfoOrBuilder> + internalGetAuthenticationFieldBuilder() { + if (authenticationBuilder_ == null) { + authenticationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.AuthenticationInfo, io.a2a.grpc.AuthenticationInfo.Builder, io.a2a.grpc.AuthenticationInfoOrBuilder>( + getAuthentication(), + getParentForChildren(), + isClean()); + authentication_ = null; + } + return authenticationBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.PushNotificationConfig) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.PushNotificationConfig) + private static final io.a2a.grpc.PushNotificationConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.PushNotificationConfig(); + } + + public static io.a2a.grpc.PushNotificationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PushNotificationConfig 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 io.a2a.grpc.PushNotificationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/PushNotificationConfigOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/PushNotificationConfigOrBuilder.java new file mode 100644 index 000000000..9aa257747 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/PushNotificationConfigOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface PushNotificationConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.PushNotificationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A unique id for this push notification.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + java.lang.String getId(); + /** + *
+   * A unique id for this push notification.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * Url to send the notification too
+   * 
+ * + * string url = 2 [json_name = "url"]; + * @return The url. + */ + java.lang.String getUrl(); + /** + *
+   * Url to send the notification too
+   * 
+ * + * string url = 2 [json_name = "url"]; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * Token unique for this task/session
+   * 
+ * + * string token = 3 [json_name = "token"]; + * @return The token. + */ + java.lang.String getToken(); + /** + *
+   * Token unique for this task/session
+   * 
+ * + * string token = 3 [json_name = "token"]; + * @return The bytes for token. + */ + com.google.protobuf.ByteString + getTokenBytes(); + + /** + *
+   * Information about the authentication to sent with the notification
+   * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + * @return Whether the authentication field is set. + */ + boolean hasAuthentication(); + /** + *
+   * Information about the authentication to sent with the notification
+   * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + * @return The authentication. + */ + io.a2a.grpc.AuthenticationInfo getAuthentication(); + /** + *
+   * Information about the authentication to sent with the notification
+   * 
+ * + * .a2a.v1.AuthenticationInfo authentication = 4 [json_name = "authentication"]; + */ + io.a2a.grpc.AuthenticationInfoOrBuilder getAuthenticationOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/Role.java b/grpc/src/main/java/io/a2a/grpc/Role.java new file mode 100644 index 000000000..25f4d57ad --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/Role.java @@ -0,0 +1,150 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf enum {@code a2a.v1.Role} + */ +@com.google.protobuf.Generated +public enum Role + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ROLE_UNSPECIFIED = 0; + */ + ROLE_UNSPECIFIED(0), + /** + *
+   * USER role refers to communication from the client to the server.
+   * 
+ * + * ROLE_USER = 1; + */ + ROLE_USER(1), + /** + *
+   * AGENT role refers to communication from the server to the client.
+   * 
+ * + * ROLE_AGENT = 2; + */ + ROLE_AGENT(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + Role.class.getName()); + } + /** + * ROLE_UNSPECIFIED = 0; + */ + public static final int ROLE_UNSPECIFIED_VALUE = 0; + /** + *
+   * USER role refers to communication from the client to the server.
+   * 
+ * + * ROLE_USER = 1; + */ + public static final int ROLE_USER_VALUE = 1; + /** + *
+   * AGENT role refers to communication from the server to the client.
+   * 
+ * + * ROLE_AGENT = 2; + */ + public static final int ROLE_AGENT_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 Role 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 Role forNumber(int value) { + switch (value) { + case 0: return ROLE_UNSPECIFIED; + case 1: return ROLE_USER; + case 2: return ROLE_AGENT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Role> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Role findValueByNumber(int number) { + return Role.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 com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.a2a.grpc.A2A.getDescriptor().getEnumTypes().get(1); + } + + private static final Role[] VALUES = values(); + + public static Role 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 Role(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:a2a.v1.Role) +} + diff --git a/grpc/src/main/java/io/a2a/grpc/Security.java b/grpc/src/main/java/io/a2a/grpc/Security.java new file mode 100644 index 000000000..f19e94a20 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/Security.java @@ -0,0 +1,672 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.Security} + */ +@com.google.protobuf.Generated +public final class Security extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.Security) + SecurityOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + Security.class.getName()); + } + // Use Security.newBuilder() to construct. + private Security(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Security() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Security_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetSchemes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Security_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Security.class, io.a2a.grpc.Security.Builder.class); + } + + public static final int SCHEMES_FIELD_NUMBER = 1; + private static final class SchemesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.a2a.grpc.StringList> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.a2a.grpc.A2A.internal_static_a2a_v1_Security_SchemesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.a2a.grpc.StringList.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, io.a2a.grpc.StringList> schemes_; + private com.google.protobuf.MapField + internalGetSchemes() { + if (schemes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SchemesDefaultEntryHolder.defaultEntry); + } + return schemes_; + } + public int getSchemesCount() { + return internalGetSchemes().getMap().size(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public boolean containsSchemes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSchemes().getMap().containsKey(key); + } + /** + * Use {@link #getSchemesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSchemes() { + return getSchemesMap(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public java.util.Map getSchemesMap() { + return internalGetSchemes().getMap(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public /* nullable */ +io.a2a.grpc.StringList getSchemesOrDefault( + java.lang.String key, + /* nullable */ +io.a2a.grpc.StringList defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSchemes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public io.a2a.grpc.StringList getSchemesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSchemes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetSchemes(), + SchemesDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetSchemes().getMap().entrySet()) { + com.google.protobuf.MapEntry + schemes__ = SchemesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, schemes__); + } + 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 io.a2a.grpc.Security)) { + return super.equals(obj); + } + io.a2a.grpc.Security other = (io.a2a.grpc.Security) obj; + + if (!internalGetSchemes().equals( + other.internalGetSchemes())) 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 (!internalGetSchemes().getMap().isEmpty()) { + hash = (37 * hash) + SCHEMES_FIELD_NUMBER; + hash = (53 * hash) + internalGetSchemes().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.Security parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Security parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Security parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Security parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Security parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Security parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Security parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Security parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.Security parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.Security parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.Security parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Security parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.Security 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.Security} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.Security) + io.a2a.grpc.SecurityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Security_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetSchemes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableSchemes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Security_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Security.class, io.a2a.grpc.Security.Builder.class); + } + + // Construct using io.a2a.grpc.Security.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableSchemes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Security_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.Security getDefaultInstanceForType() { + return io.a2a.grpc.Security.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.Security build() { + io.a2a.grpc.Security result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.Security buildPartial() { + io.a2a.grpc.Security result = new io.a2a.grpc.Security(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.Security result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.schemes_ = internalGetSchemes().build(SchemesDefaultEntryHolder.defaultEntry); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.Security) { + return mergeFrom((io.a2a.grpc.Security)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.Security other) { + if (other == io.a2a.grpc.Security.getDefaultInstance()) return this; + internalGetMutableSchemes().mergeFrom( + other.internalGetSchemes()); + bitField0_ |= 0x00000001; + 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.protobuf.MapEntry + schemes__ = input.readMessage( + SchemesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableSchemes().ensureBuilderMap().put( + schemes__.getKey(), schemes__.getValue()); + 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 static final class SchemesConverter implements com.google.protobuf.MapFieldBuilder.Converter { + @java.lang.Override + public io.a2a.grpc.StringList build(io.a2a.grpc.StringListOrBuilder val) { + if (val instanceof io.a2a.grpc.StringList) { return (io.a2a.grpc.StringList) val; } + return ((io.a2a.grpc.StringList.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return SchemesDefaultEntryHolder.defaultEntry; + } + }; + private static final SchemesConverter schemesConverter = new SchemesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, io.a2a.grpc.StringListOrBuilder, io.a2a.grpc.StringList, io.a2a.grpc.StringList.Builder> schemes_; + private com.google.protobuf.MapFieldBuilder + internalGetSchemes() { + if (schemes_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(schemesConverter); + } + return schemes_; + } + private com.google.protobuf.MapFieldBuilder + internalGetMutableSchemes() { + if (schemes_ == null) { + schemes_ = new com.google.protobuf.MapFieldBuilder<>(schemesConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return schemes_; + } + public int getSchemesCount() { + return internalGetSchemes().ensureBuilderMap().size(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public boolean containsSchemes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSchemes().ensureBuilderMap().containsKey(key); + } + /** + * Use {@link #getSchemesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSchemes() { + return getSchemesMap(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public java.util.Map getSchemesMap() { + return internalGetSchemes().getImmutableMap(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public /* nullable */ +io.a2a.grpc.StringList getSchemesOrDefault( + java.lang.String key, + /* nullable */ +io.a2a.grpc.StringList defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSchemes().ensureBuilderMap(); + return map.containsKey(key) ? schemesConverter.build(map.get(key)) : defaultValue; + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + @java.lang.Override + public io.a2a.grpc.StringList getSchemesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = internalGetMutableSchemes().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return schemesConverter.build(map.get(key)); + } + public Builder clearSchemes() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableSchemes().clear(); + return this; + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + public Builder removeSchemes( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableSchemes().ensureBuilderMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableSchemes() { + bitField0_ |= 0x00000001; + return internalGetMutableSchemes().ensureMessageMap(); + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + public Builder putSchemes( + java.lang.String key, + io.a2a.grpc.StringList value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableSchemes().ensureBuilderMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + public Builder putAllSchemes( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableSchemes().ensureBuilderMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + public io.a2a.grpc.StringList.Builder putSchemesBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = internalGetMutableSchemes().ensureBuilderMap(); + io.a2a.grpc.StringListOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = io.a2a.grpc.StringList.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof io.a2a.grpc.StringList) { + entry = ((io.a2a.grpc.StringList) entry).toBuilder(); + builderMap.put(key, entry); + } + return (io.a2a.grpc.StringList.Builder) entry; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.Security) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.Security) + private static final io.a2a.grpc.Security DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.Security(); + } + + public static io.a2a.grpc.Security getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Security 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 io.a2a.grpc.Security getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/SecurityOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/SecurityOrBuilder.java new file mode 100644 index 000000000..c6cad1a13 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SecurityOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface SecurityOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.Security) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + int getSchemesCount(); + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + boolean containsSchemes( + java.lang.String key); + /** + * Use {@link #getSchemesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSchemes(); + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + java.util.Map + getSchemesMap(); + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + /* nullable */ +io.a2a.grpc.StringList getSchemesOrDefault( + java.lang.String key, + /* nullable */ +io.a2a.grpc.StringList defaultValue); + /** + * map<string, .a2a.v1.StringList> schemes = 1 [json_name = "schemes"]; + */ + io.a2a.grpc.StringList getSchemesOrThrow( + java.lang.String key); +} diff --git a/grpc/src/main/java/io/a2a/grpc/SecurityScheme.java b/grpc/src/main/java/io/a2a/grpc/SecurityScheme.java new file mode 100644 index 000000000..a0de79755 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SecurityScheme.java @@ -0,0 +1,1273 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.SecurityScheme} + */ +@com.google.protobuf.Generated +public final class SecurityScheme extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.SecurityScheme) + SecuritySchemeOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + SecurityScheme.class.getName()); + } + // Use SecurityScheme.newBuilder() to construct. + private SecurityScheme(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SecurityScheme() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SecurityScheme.class, io.a2a.grpc.SecurityScheme.Builder.class); + } + + private int schemeCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object scheme_; + public enum SchemeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + API_KEY_SECURITY_SCHEME(1), + HTTP_AUTH_SECURITY_SCHEME(2), + OAUTH2_SECURITY_SCHEME(3), + OPEN_ID_CONNECT_SECURITY_SCHEME(4), + SCHEME_NOT_SET(0); + private final int value; + private SchemeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SchemeCase valueOf(int value) { + return forNumber(value); + } + + public static SchemeCase forNumber(int value) { + switch (value) { + case 1: return API_KEY_SECURITY_SCHEME; + case 2: return HTTP_AUTH_SECURITY_SCHEME; + case 3: return OAUTH2_SECURITY_SCHEME; + case 4: return OPEN_ID_CONNECT_SECURITY_SCHEME; + case 0: return SCHEME_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SchemeCase + getSchemeCase() { + return SchemeCase.forNumber( + schemeCase_); + } + + public static final int API_KEY_SECURITY_SCHEME_FIELD_NUMBER = 1; + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + * @return Whether the apiKeySecurityScheme field is set. + */ + @java.lang.Override + public boolean hasApiKeySecurityScheme() { + return schemeCase_ == 1; + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + * @return The apiKeySecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.APIKeySecurityScheme getApiKeySecurityScheme() { + if (schemeCase_ == 1) { + return (io.a2a.grpc.APIKeySecurityScheme) scheme_; + } + return io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.APIKeySecuritySchemeOrBuilder getApiKeySecuritySchemeOrBuilder() { + if (schemeCase_ == 1) { + return (io.a2a.grpc.APIKeySecurityScheme) scheme_; + } + return io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } + + public static final int HTTP_AUTH_SECURITY_SCHEME_FIELD_NUMBER = 2; + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + * @return Whether the httpAuthSecurityScheme field is set. + */ + @java.lang.Override + public boolean hasHttpAuthSecurityScheme() { + return schemeCase_ == 2; + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + * @return The httpAuthSecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecurityScheme getHttpAuthSecurityScheme() { + if (schemeCase_ == 2) { + return (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_; + } + return io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder getHttpAuthSecuritySchemeOrBuilder() { + if (schemeCase_ == 2) { + return (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_; + } + return io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } + + public static final int OAUTH2_SECURITY_SCHEME_FIELD_NUMBER = 3; + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + * @return Whether the oauth2SecurityScheme field is set. + */ + @java.lang.Override + public boolean hasOauth2SecurityScheme() { + return schemeCase_ == 3; + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + * @return The oauth2SecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.OAuth2SecurityScheme getOauth2SecurityScheme() { + if (schemeCase_ == 3) { + return (io.a2a.grpc.OAuth2SecurityScheme) scheme_; + } + return io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.OAuth2SecuritySchemeOrBuilder getOauth2SecuritySchemeOrBuilder() { + if (schemeCase_ == 3) { + return (io.a2a.grpc.OAuth2SecurityScheme) scheme_; + } + return io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } + + public static final int OPEN_ID_CONNECT_SECURITY_SCHEME_FIELD_NUMBER = 4; + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + * @return Whether the openIdConnectSecurityScheme field is set. + */ + @java.lang.Override + public boolean hasOpenIdConnectSecurityScheme() { + return schemeCase_ == 4; + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + * @return The openIdConnectSecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecurityScheme getOpenIdConnectSecurityScheme() { + if (schemeCase_ == 4) { + return (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_; + } + return io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder getOpenIdConnectSecuritySchemeOrBuilder() { + if (schemeCase_ == 4) { + return (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_; + } + return io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } + + 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 (schemeCase_ == 1) { + output.writeMessage(1, (io.a2a.grpc.APIKeySecurityScheme) scheme_); + } + if (schemeCase_ == 2) { + output.writeMessage(2, (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_); + } + if (schemeCase_ == 3) { + output.writeMessage(3, (io.a2a.grpc.OAuth2SecurityScheme) scheme_); + } + if (schemeCase_ == 4) { + output.writeMessage(4, (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (schemeCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.a2a.grpc.APIKeySecurityScheme) scheme_); + } + if (schemeCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_); + } + if (schemeCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (io.a2a.grpc.OAuth2SecurityScheme) scheme_); + } + if (schemeCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_); + } + 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 io.a2a.grpc.SecurityScheme)) { + return super.equals(obj); + } + io.a2a.grpc.SecurityScheme other = (io.a2a.grpc.SecurityScheme) obj; + + if (!getSchemeCase().equals(other.getSchemeCase())) return false; + switch (schemeCase_) { + case 1: + if (!getApiKeySecurityScheme() + .equals(other.getApiKeySecurityScheme())) return false; + break; + case 2: + if (!getHttpAuthSecurityScheme() + .equals(other.getHttpAuthSecurityScheme())) return false; + break; + case 3: + if (!getOauth2SecurityScheme() + .equals(other.getOauth2SecurityScheme())) return false; + break; + case 4: + if (!getOpenIdConnectSecurityScheme() + .equals(other.getOpenIdConnectSecurityScheme())) return false; + break; + case 0: + default: + } + 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(); + switch (schemeCase_) { + case 1: + hash = (37 * hash) + API_KEY_SECURITY_SCHEME_FIELD_NUMBER; + hash = (53 * hash) + getApiKeySecurityScheme().hashCode(); + break; + case 2: + hash = (37 * hash) + HTTP_AUTH_SECURITY_SCHEME_FIELD_NUMBER; + hash = (53 * hash) + getHttpAuthSecurityScheme().hashCode(); + break; + case 3: + hash = (37 * hash) + OAUTH2_SECURITY_SCHEME_FIELD_NUMBER; + hash = (53 * hash) + getOauth2SecurityScheme().hashCode(); + break; + case 4: + hash = (37 * hash) + OPEN_ID_CONNECT_SECURITY_SCHEME_FIELD_NUMBER; + hash = (53 * hash) + getOpenIdConnectSecurityScheme().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.SecurityScheme parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SecurityScheme parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SecurityScheme parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.SecurityScheme parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.SecurityScheme parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SecurityScheme parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.SecurityScheme 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.SecurityScheme} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.SecurityScheme) + io.a2a.grpc.SecuritySchemeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SecurityScheme_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SecurityScheme_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SecurityScheme.class, io.a2a.grpc.SecurityScheme.Builder.class); + } + + // Construct using io.a2a.grpc.SecurityScheme.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (apiKeySecuritySchemeBuilder_ != null) { + apiKeySecuritySchemeBuilder_.clear(); + } + if (httpAuthSecuritySchemeBuilder_ != null) { + httpAuthSecuritySchemeBuilder_.clear(); + } + if (oauth2SecuritySchemeBuilder_ != null) { + oauth2SecuritySchemeBuilder_.clear(); + } + if (openIdConnectSecuritySchemeBuilder_ != null) { + openIdConnectSecuritySchemeBuilder_.clear(); + } + schemeCase_ = 0; + scheme_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SecurityScheme_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.SecurityScheme getDefaultInstanceForType() { + return io.a2a.grpc.SecurityScheme.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.SecurityScheme build() { + io.a2a.grpc.SecurityScheme result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.SecurityScheme buildPartial() { + io.a2a.grpc.SecurityScheme result = new io.a2a.grpc.SecurityScheme(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.SecurityScheme result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(io.a2a.grpc.SecurityScheme result) { + result.schemeCase_ = schemeCase_; + result.scheme_ = this.scheme_; + if (schemeCase_ == 1 && + apiKeySecuritySchemeBuilder_ != null) { + result.scheme_ = apiKeySecuritySchemeBuilder_.build(); + } + if (schemeCase_ == 2 && + httpAuthSecuritySchemeBuilder_ != null) { + result.scheme_ = httpAuthSecuritySchemeBuilder_.build(); + } + if (schemeCase_ == 3 && + oauth2SecuritySchemeBuilder_ != null) { + result.scheme_ = oauth2SecuritySchemeBuilder_.build(); + } + if (schemeCase_ == 4 && + openIdConnectSecuritySchemeBuilder_ != null) { + result.scheme_ = openIdConnectSecuritySchemeBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.SecurityScheme) { + return mergeFrom((io.a2a.grpc.SecurityScheme)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.SecurityScheme other) { + if (other == io.a2a.grpc.SecurityScheme.getDefaultInstance()) return this; + switch (other.getSchemeCase()) { + case API_KEY_SECURITY_SCHEME: { + mergeApiKeySecurityScheme(other.getApiKeySecurityScheme()); + break; + } + case HTTP_AUTH_SECURITY_SCHEME: { + mergeHttpAuthSecurityScheme(other.getHttpAuthSecurityScheme()); + break; + } + case OAUTH2_SECURITY_SCHEME: { + mergeOauth2SecurityScheme(other.getOauth2SecurityScheme()); + break; + } + case OPEN_ID_CONNECT_SECURITY_SCHEME: { + mergeOpenIdConnectSecurityScheme(other.getOpenIdConnectSecurityScheme()); + break; + } + case SCHEME_NOT_SET: { + break; + } + } + 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: { + input.readMessage( + internalGetApiKeySecuritySchemeFieldBuilder().getBuilder(), + extensionRegistry); + schemeCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetHttpAuthSecuritySchemeFieldBuilder().getBuilder(), + extensionRegistry); + schemeCase_ = 2; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetOauth2SecuritySchemeFieldBuilder().getBuilder(), + extensionRegistry); + schemeCase_ = 3; + break; + } // case 26 + case 34: { + input.readMessage( + internalGetOpenIdConnectSecuritySchemeFieldBuilder().getBuilder(), + extensionRegistry); + schemeCase_ = 4; + break; + } // case 34 + 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 schemeCase_ = 0; + private java.lang.Object scheme_; + public SchemeCase + getSchemeCase() { + return SchemeCase.forNumber( + schemeCase_); + } + + public Builder clearScheme() { + schemeCase_ = 0; + scheme_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.APIKeySecurityScheme, io.a2a.grpc.APIKeySecurityScheme.Builder, io.a2a.grpc.APIKeySecuritySchemeOrBuilder> apiKeySecuritySchemeBuilder_; + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + * @return Whether the apiKeySecurityScheme field is set. + */ + @java.lang.Override + public boolean hasApiKeySecurityScheme() { + return schemeCase_ == 1; + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + * @return The apiKeySecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.APIKeySecurityScheme getApiKeySecurityScheme() { + if (apiKeySecuritySchemeBuilder_ == null) { + if (schemeCase_ == 1) { + return (io.a2a.grpc.APIKeySecurityScheme) scheme_; + } + return io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } else { + if (schemeCase_ == 1) { + return apiKeySecuritySchemeBuilder_.getMessage(); + } + return io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + public Builder setApiKeySecurityScheme(io.a2a.grpc.APIKeySecurityScheme value) { + if (apiKeySecuritySchemeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheme_ = value; + onChanged(); + } else { + apiKeySecuritySchemeBuilder_.setMessage(value); + } + schemeCase_ = 1; + return this; + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + public Builder setApiKeySecurityScheme( + io.a2a.grpc.APIKeySecurityScheme.Builder builderForValue) { + if (apiKeySecuritySchemeBuilder_ == null) { + scheme_ = builderForValue.build(); + onChanged(); + } else { + apiKeySecuritySchemeBuilder_.setMessage(builderForValue.build()); + } + schemeCase_ = 1; + return this; + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + public Builder mergeApiKeySecurityScheme(io.a2a.grpc.APIKeySecurityScheme value) { + if (apiKeySecuritySchemeBuilder_ == null) { + if (schemeCase_ == 1 && + scheme_ != io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance()) { + scheme_ = io.a2a.grpc.APIKeySecurityScheme.newBuilder((io.a2a.grpc.APIKeySecurityScheme) scheme_) + .mergeFrom(value).buildPartial(); + } else { + scheme_ = value; + } + onChanged(); + } else { + if (schemeCase_ == 1) { + apiKeySecuritySchemeBuilder_.mergeFrom(value); + } else { + apiKeySecuritySchemeBuilder_.setMessage(value); + } + } + schemeCase_ = 1; + return this; + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + public Builder clearApiKeySecurityScheme() { + if (apiKeySecuritySchemeBuilder_ == null) { + if (schemeCase_ == 1) { + schemeCase_ = 0; + scheme_ = null; + onChanged(); + } + } else { + if (schemeCase_ == 1) { + schemeCase_ = 0; + scheme_ = null; + } + apiKeySecuritySchemeBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + public io.a2a.grpc.APIKeySecurityScheme.Builder getApiKeySecuritySchemeBuilder() { + return internalGetApiKeySecuritySchemeFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.APIKeySecuritySchemeOrBuilder getApiKeySecuritySchemeOrBuilder() { + if ((schemeCase_ == 1) && (apiKeySecuritySchemeBuilder_ != null)) { + return apiKeySecuritySchemeBuilder_.getMessageOrBuilder(); + } else { + if (schemeCase_ == 1) { + return (io.a2a.grpc.APIKeySecurityScheme) scheme_; + } + return io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.APIKeySecurityScheme, io.a2a.grpc.APIKeySecurityScheme.Builder, io.a2a.grpc.APIKeySecuritySchemeOrBuilder> + internalGetApiKeySecuritySchemeFieldBuilder() { + if (apiKeySecuritySchemeBuilder_ == null) { + if (!(schemeCase_ == 1)) { + scheme_ = io.a2a.grpc.APIKeySecurityScheme.getDefaultInstance(); + } + apiKeySecuritySchemeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.APIKeySecurityScheme, io.a2a.grpc.APIKeySecurityScheme.Builder, io.a2a.grpc.APIKeySecuritySchemeOrBuilder>( + (io.a2a.grpc.APIKeySecurityScheme) scheme_, + getParentForChildren(), + isClean()); + scheme_ = null; + } + schemeCase_ = 1; + onChanged(); + return apiKeySecuritySchemeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.HTTPAuthSecurityScheme, io.a2a.grpc.HTTPAuthSecurityScheme.Builder, io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder> httpAuthSecuritySchemeBuilder_; + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + * @return Whether the httpAuthSecurityScheme field is set. + */ + @java.lang.Override + public boolean hasHttpAuthSecurityScheme() { + return schemeCase_ == 2; + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + * @return The httpAuthSecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecurityScheme getHttpAuthSecurityScheme() { + if (httpAuthSecuritySchemeBuilder_ == null) { + if (schemeCase_ == 2) { + return (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_; + } + return io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } else { + if (schemeCase_ == 2) { + return httpAuthSecuritySchemeBuilder_.getMessage(); + } + return io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + public Builder setHttpAuthSecurityScheme(io.a2a.grpc.HTTPAuthSecurityScheme value) { + if (httpAuthSecuritySchemeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheme_ = value; + onChanged(); + } else { + httpAuthSecuritySchemeBuilder_.setMessage(value); + } + schemeCase_ = 2; + return this; + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + public Builder setHttpAuthSecurityScheme( + io.a2a.grpc.HTTPAuthSecurityScheme.Builder builderForValue) { + if (httpAuthSecuritySchemeBuilder_ == null) { + scheme_ = builderForValue.build(); + onChanged(); + } else { + httpAuthSecuritySchemeBuilder_.setMessage(builderForValue.build()); + } + schemeCase_ = 2; + return this; + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + public Builder mergeHttpAuthSecurityScheme(io.a2a.grpc.HTTPAuthSecurityScheme value) { + if (httpAuthSecuritySchemeBuilder_ == null) { + if (schemeCase_ == 2 && + scheme_ != io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance()) { + scheme_ = io.a2a.grpc.HTTPAuthSecurityScheme.newBuilder((io.a2a.grpc.HTTPAuthSecurityScheme) scheme_) + .mergeFrom(value).buildPartial(); + } else { + scheme_ = value; + } + onChanged(); + } else { + if (schemeCase_ == 2) { + httpAuthSecuritySchemeBuilder_.mergeFrom(value); + } else { + httpAuthSecuritySchemeBuilder_.setMessage(value); + } + } + schemeCase_ = 2; + return this; + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + public Builder clearHttpAuthSecurityScheme() { + if (httpAuthSecuritySchemeBuilder_ == null) { + if (schemeCase_ == 2) { + schemeCase_ = 0; + scheme_ = null; + onChanged(); + } + } else { + if (schemeCase_ == 2) { + schemeCase_ = 0; + scheme_ = null; + } + httpAuthSecuritySchemeBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + public io.a2a.grpc.HTTPAuthSecurityScheme.Builder getHttpAuthSecuritySchemeBuilder() { + return internalGetHttpAuthSecuritySchemeFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder getHttpAuthSecuritySchemeOrBuilder() { + if ((schemeCase_ == 2) && (httpAuthSecuritySchemeBuilder_ != null)) { + return httpAuthSecuritySchemeBuilder_.getMessageOrBuilder(); + } else { + if (schemeCase_ == 2) { + return (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_; + } + return io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.HTTPAuthSecurityScheme, io.a2a.grpc.HTTPAuthSecurityScheme.Builder, io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder> + internalGetHttpAuthSecuritySchemeFieldBuilder() { + if (httpAuthSecuritySchemeBuilder_ == null) { + if (!(schemeCase_ == 2)) { + scheme_ = io.a2a.grpc.HTTPAuthSecurityScheme.getDefaultInstance(); + } + httpAuthSecuritySchemeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.HTTPAuthSecurityScheme, io.a2a.grpc.HTTPAuthSecurityScheme.Builder, io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder>( + (io.a2a.grpc.HTTPAuthSecurityScheme) scheme_, + getParentForChildren(), + isClean()); + scheme_ = null; + } + schemeCase_ = 2; + onChanged(); + return httpAuthSecuritySchemeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OAuth2SecurityScheme, io.a2a.grpc.OAuth2SecurityScheme.Builder, io.a2a.grpc.OAuth2SecuritySchemeOrBuilder> oauth2SecuritySchemeBuilder_; + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + * @return Whether the oauth2SecurityScheme field is set. + */ + @java.lang.Override + public boolean hasOauth2SecurityScheme() { + return schemeCase_ == 3; + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + * @return The oauth2SecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.OAuth2SecurityScheme getOauth2SecurityScheme() { + if (oauth2SecuritySchemeBuilder_ == null) { + if (schemeCase_ == 3) { + return (io.a2a.grpc.OAuth2SecurityScheme) scheme_; + } + return io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } else { + if (schemeCase_ == 3) { + return oauth2SecuritySchemeBuilder_.getMessage(); + } + return io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + public Builder setOauth2SecurityScheme(io.a2a.grpc.OAuth2SecurityScheme value) { + if (oauth2SecuritySchemeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheme_ = value; + onChanged(); + } else { + oauth2SecuritySchemeBuilder_.setMessage(value); + } + schemeCase_ = 3; + return this; + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + public Builder setOauth2SecurityScheme( + io.a2a.grpc.OAuth2SecurityScheme.Builder builderForValue) { + if (oauth2SecuritySchemeBuilder_ == null) { + scheme_ = builderForValue.build(); + onChanged(); + } else { + oauth2SecuritySchemeBuilder_.setMessage(builderForValue.build()); + } + schemeCase_ = 3; + return this; + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + public Builder mergeOauth2SecurityScheme(io.a2a.grpc.OAuth2SecurityScheme value) { + if (oauth2SecuritySchemeBuilder_ == null) { + if (schemeCase_ == 3 && + scheme_ != io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance()) { + scheme_ = io.a2a.grpc.OAuth2SecurityScheme.newBuilder((io.a2a.grpc.OAuth2SecurityScheme) scheme_) + .mergeFrom(value).buildPartial(); + } else { + scheme_ = value; + } + onChanged(); + } else { + if (schemeCase_ == 3) { + oauth2SecuritySchemeBuilder_.mergeFrom(value); + } else { + oauth2SecuritySchemeBuilder_.setMessage(value); + } + } + schemeCase_ = 3; + return this; + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + public Builder clearOauth2SecurityScheme() { + if (oauth2SecuritySchemeBuilder_ == null) { + if (schemeCase_ == 3) { + schemeCase_ = 0; + scheme_ = null; + onChanged(); + } + } else { + if (schemeCase_ == 3) { + schemeCase_ = 0; + scheme_ = null; + } + oauth2SecuritySchemeBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + public io.a2a.grpc.OAuth2SecurityScheme.Builder getOauth2SecuritySchemeBuilder() { + return internalGetOauth2SecuritySchemeFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.OAuth2SecuritySchemeOrBuilder getOauth2SecuritySchemeOrBuilder() { + if ((schemeCase_ == 3) && (oauth2SecuritySchemeBuilder_ != null)) { + return oauth2SecuritySchemeBuilder_.getMessageOrBuilder(); + } else { + if (schemeCase_ == 3) { + return (io.a2a.grpc.OAuth2SecurityScheme) scheme_; + } + return io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OAuth2SecurityScheme, io.a2a.grpc.OAuth2SecurityScheme.Builder, io.a2a.grpc.OAuth2SecuritySchemeOrBuilder> + internalGetOauth2SecuritySchemeFieldBuilder() { + if (oauth2SecuritySchemeBuilder_ == null) { + if (!(schemeCase_ == 3)) { + scheme_ = io.a2a.grpc.OAuth2SecurityScheme.getDefaultInstance(); + } + oauth2SecuritySchemeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OAuth2SecurityScheme, io.a2a.grpc.OAuth2SecurityScheme.Builder, io.a2a.grpc.OAuth2SecuritySchemeOrBuilder>( + (io.a2a.grpc.OAuth2SecurityScheme) scheme_, + getParentForChildren(), + isClean()); + scheme_ = null; + } + schemeCase_ = 3; + onChanged(); + return oauth2SecuritySchemeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OpenIdConnectSecurityScheme, io.a2a.grpc.OpenIdConnectSecurityScheme.Builder, io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder> openIdConnectSecuritySchemeBuilder_; + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + * @return Whether the openIdConnectSecurityScheme field is set. + */ + @java.lang.Override + public boolean hasOpenIdConnectSecurityScheme() { + return schemeCase_ == 4; + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + * @return The openIdConnectSecurityScheme. + */ + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecurityScheme getOpenIdConnectSecurityScheme() { + if (openIdConnectSecuritySchemeBuilder_ == null) { + if (schemeCase_ == 4) { + return (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_; + } + return io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } else { + if (schemeCase_ == 4) { + return openIdConnectSecuritySchemeBuilder_.getMessage(); + } + return io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + public Builder setOpenIdConnectSecurityScheme(io.a2a.grpc.OpenIdConnectSecurityScheme value) { + if (openIdConnectSecuritySchemeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheme_ = value; + onChanged(); + } else { + openIdConnectSecuritySchemeBuilder_.setMessage(value); + } + schemeCase_ = 4; + return this; + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + public Builder setOpenIdConnectSecurityScheme( + io.a2a.grpc.OpenIdConnectSecurityScheme.Builder builderForValue) { + if (openIdConnectSecuritySchemeBuilder_ == null) { + scheme_ = builderForValue.build(); + onChanged(); + } else { + openIdConnectSecuritySchemeBuilder_.setMessage(builderForValue.build()); + } + schemeCase_ = 4; + return this; + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + public Builder mergeOpenIdConnectSecurityScheme(io.a2a.grpc.OpenIdConnectSecurityScheme value) { + if (openIdConnectSecuritySchemeBuilder_ == null) { + if (schemeCase_ == 4 && + scheme_ != io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance()) { + scheme_ = io.a2a.grpc.OpenIdConnectSecurityScheme.newBuilder((io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_) + .mergeFrom(value).buildPartial(); + } else { + scheme_ = value; + } + onChanged(); + } else { + if (schemeCase_ == 4) { + openIdConnectSecuritySchemeBuilder_.mergeFrom(value); + } else { + openIdConnectSecuritySchemeBuilder_.setMessage(value); + } + } + schemeCase_ = 4; + return this; + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + public Builder clearOpenIdConnectSecurityScheme() { + if (openIdConnectSecuritySchemeBuilder_ == null) { + if (schemeCase_ == 4) { + schemeCase_ = 0; + scheme_ = null; + onChanged(); + } + } else { + if (schemeCase_ == 4) { + schemeCase_ = 0; + scheme_ = null; + } + openIdConnectSecuritySchemeBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + public io.a2a.grpc.OpenIdConnectSecurityScheme.Builder getOpenIdConnectSecuritySchemeBuilder() { + return internalGetOpenIdConnectSecuritySchemeFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + @java.lang.Override + public io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder getOpenIdConnectSecuritySchemeOrBuilder() { + if ((schemeCase_ == 4) && (openIdConnectSecuritySchemeBuilder_ != null)) { + return openIdConnectSecuritySchemeBuilder_.getMessageOrBuilder(); + } else { + if (schemeCase_ == 4) { + return (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_; + } + return io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } + } + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OpenIdConnectSecurityScheme, io.a2a.grpc.OpenIdConnectSecurityScheme.Builder, io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder> + internalGetOpenIdConnectSecuritySchemeFieldBuilder() { + if (openIdConnectSecuritySchemeBuilder_ == null) { + if (!(schemeCase_ == 4)) { + scheme_ = io.a2a.grpc.OpenIdConnectSecurityScheme.getDefaultInstance(); + } + openIdConnectSecuritySchemeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.OpenIdConnectSecurityScheme, io.a2a.grpc.OpenIdConnectSecurityScheme.Builder, io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder>( + (io.a2a.grpc.OpenIdConnectSecurityScheme) scheme_, + getParentForChildren(), + isClean()); + scheme_ = null; + } + schemeCase_ = 4; + onChanged(); + return openIdConnectSecuritySchemeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.SecurityScheme) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.SecurityScheme) + private static final io.a2a.grpc.SecurityScheme DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.SecurityScheme(); + } + + public static io.a2a.grpc.SecurityScheme getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityScheme 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 io.a2a.grpc.SecurityScheme getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/SecuritySchemeOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/SecuritySchemeOrBuilder.java new file mode 100644 index 000000000..ed4aa69c0 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SecuritySchemeOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface SecuritySchemeOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.SecurityScheme) + com.google.protobuf.MessageOrBuilder { + + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + * @return Whether the apiKeySecurityScheme field is set. + */ + boolean hasApiKeySecurityScheme(); + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + * @return The apiKeySecurityScheme. + */ + io.a2a.grpc.APIKeySecurityScheme getApiKeySecurityScheme(); + /** + * .a2a.v1.APIKeySecurityScheme api_key_security_scheme = 1 [json_name = "apiKeySecurityScheme"]; + */ + io.a2a.grpc.APIKeySecuritySchemeOrBuilder getApiKeySecuritySchemeOrBuilder(); + + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + * @return Whether the httpAuthSecurityScheme field is set. + */ + boolean hasHttpAuthSecurityScheme(); + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + * @return The httpAuthSecurityScheme. + */ + io.a2a.grpc.HTTPAuthSecurityScheme getHttpAuthSecurityScheme(); + /** + * .a2a.v1.HTTPAuthSecurityScheme http_auth_security_scheme = 2 [json_name = "httpAuthSecurityScheme"]; + */ + io.a2a.grpc.HTTPAuthSecuritySchemeOrBuilder getHttpAuthSecuritySchemeOrBuilder(); + + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + * @return Whether the oauth2SecurityScheme field is set. + */ + boolean hasOauth2SecurityScheme(); + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + * @return The oauth2SecurityScheme. + */ + io.a2a.grpc.OAuth2SecurityScheme getOauth2SecurityScheme(); + /** + * .a2a.v1.OAuth2SecurityScheme oauth2_security_scheme = 3 [json_name = "oauth2SecurityScheme"]; + */ + io.a2a.grpc.OAuth2SecuritySchemeOrBuilder getOauth2SecuritySchemeOrBuilder(); + + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + * @return Whether the openIdConnectSecurityScheme field is set. + */ + boolean hasOpenIdConnectSecurityScheme(); + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + * @return The openIdConnectSecurityScheme. + */ + io.a2a.grpc.OpenIdConnectSecurityScheme getOpenIdConnectSecurityScheme(); + /** + * .a2a.v1.OpenIdConnectSecurityScheme open_id_connect_security_scheme = 4 [json_name = "openIdConnectSecurityScheme"]; + */ + io.a2a.grpc.OpenIdConnectSecuritySchemeOrBuilder getOpenIdConnectSecuritySchemeOrBuilder(); + + io.a2a.grpc.SecurityScheme.SchemeCase getSchemeCase(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/SendMessageConfiguration.java b/grpc/src/main/java/io/a2a/grpc/SendMessageConfiguration.java new file mode 100644 index 000000000..42bd62bcc --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SendMessageConfiguration.java @@ -0,0 +1,1037 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Configuration of a send message request.
+ * 
+ * + * Protobuf type {@code a2a.v1.SendMessageConfiguration} + */ +@com.google.protobuf.Generated +public final class SendMessageConfiguration extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.SendMessageConfiguration) + SendMessageConfigurationOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + SendMessageConfiguration.class.getName()); + } + // Use SendMessageConfiguration.newBuilder() to construct. + private SendMessageConfiguration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SendMessageConfiguration() { + acceptedOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SendMessageConfiguration.class, io.a2a.grpc.SendMessageConfiguration.Builder.class); + } + + private int bitField0_; + public static final int ACCEPTED_OUTPUT_MODES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList acceptedOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return A list containing the acceptedOutputModes. + */ + public com.google.protobuf.ProtocolStringList + getAcceptedOutputModesList() { + return acceptedOutputModes_; + } + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return The count of acceptedOutputModes. + */ + public int getAcceptedOutputModesCount() { + return acceptedOutputModes_.size(); + } + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index of the element to return. + * @return The acceptedOutputModes at the given index. + */ + public java.lang.String getAcceptedOutputModes(int index) { + return acceptedOutputModes_.get(index); + } + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index of the value to return. + * @return The bytes of the acceptedOutputModes at the given index. + */ + public com.google.protobuf.ByteString + getAcceptedOutputModesBytes(int index) { + return acceptedOutputModes_.getByteString(index); + } + + public static final int PUSH_NOTIFICATION_FIELD_NUMBER = 2; + private io.a2a.grpc.PushNotificationConfig pushNotification_; + /** + *
+   * A configuration of a webhook that can be used to receive updates
+   * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + * @return Whether the pushNotification field is set. + */ + @java.lang.Override + public boolean hasPushNotification() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * A configuration of a webhook that can be used to receive updates
+   * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + * @return The pushNotification. + */ + @java.lang.Override + public io.a2a.grpc.PushNotificationConfig getPushNotification() { + return pushNotification_ == null ? io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotification_; + } + /** + *
+   * A configuration of a webhook that can be used to receive updates
+   * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + @java.lang.Override + public io.a2a.grpc.PushNotificationConfigOrBuilder getPushNotificationOrBuilder() { + return pushNotification_ == null ? io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotification_; + } + + public static final int HISTORY_LENGTH_FIELD_NUMBER = 3; + private int historyLength_ = 0; + /** + *
+   * The maximum number of messages to include in the history. if 0, the
+   * history will be unlimited.
+   * 
+ * + * int32 history_length = 3 [json_name = "historyLength"]; + * @return The historyLength. + */ + @java.lang.Override + public int getHistoryLength() { + return historyLength_; + } + + public static final int BLOCKING_FIELD_NUMBER = 4; + private boolean blocking_ = false; + /** + *
+   * If true, the message will be blocking until the task is completed. If
+   * false, the message will be non-blocking and the task will be returned
+   * immediately. It is the caller's responsibility to check for any task
+   * updates.
+   * 
+ * + * bool blocking = 4 [json_name = "blocking"]; + * @return The blocking. + */ + @java.lang.Override + public boolean getBlocking() { + return blocking_; + } + + 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 < acceptedOutputModes_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, acceptedOutputModes_.getRaw(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPushNotification()); + } + if (historyLength_ != 0) { + output.writeInt32(3, historyLength_); + } + if (blocking_ != false) { + output.writeBool(4, blocking_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < acceptedOutputModes_.size(); i++) { + dataSize += computeStringSizeNoTag(acceptedOutputModes_.getRaw(i)); + } + size += dataSize; + size += 1 * getAcceptedOutputModesList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPushNotification()); + } + if (historyLength_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, historyLength_); + } + if (blocking_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, blocking_); + } + 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 io.a2a.grpc.SendMessageConfiguration)) { + return super.equals(obj); + } + io.a2a.grpc.SendMessageConfiguration other = (io.a2a.grpc.SendMessageConfiguration) obj; + + if (!getAcceptedOutputModesList() + .equals(other.getAcceptedOutputModesList())) return false; + if (hasPushNotification() != other.hasPushNotification()) return false; + if (hasPushNotification()) { + if (!getPushNotification() + .equals(other.getPushNotification())) return false; + } + if (getHistoryLength() + != other.getHistoryLength()) return false; + if (getBlocking() + != other.getBlocking()) 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 (getAcceptedOutputModesCount() > 0) { + hash = (37 * hash) + ACCEPTED_OUTPUT_MODES_FIELD_NUMBER; + hash = (53 * hash) + getAcceptedOutputModesList().hashCode(); + } + if (hasPushNotification()) { + hash = (37 * hash) + PUSH_NOTIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getPushNotification().hashCode(); + } + hash = (37 * hash) + HISTORY_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getHistoryLength(); + hash = (37 * hash) + BLOCKING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBlocking()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.SendMessageConfiguration parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.SendMessageConfiguration parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SendMessageConfiguration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.SendMessageConfiguration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Configuration of a send message request.
+   * 
+ * + * Protobuf type {@code a2a.v1.SendMessageConfiguration} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.SendMessageConfiguration) + io.a2a.grpc.SendMessageConfigurationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageConfiguration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageConfiguration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SendMessageConfiguration.class, io.a2a.grpc.SendMessageConfiguration.Builder.class); + } + + // Construct using io.a2a.grpc.SendMessageConfiguration.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetPushNotificationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + acceptedOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + pushNotification_ = null; + if (pushNotificationBuilder_ != null) { + pushNotificationBuilder_.dispose(); + pushNotificationBuilder_ = null; + } + historyLength_ = 0; + blocking_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageConfiguration_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.SendMessageConfiguration getDefaultInstanceForType() { + return io.a2a.grpc.SendMessageConfiguration.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.SendMessageConfiguration build() { + io.a2a.grpc.SendMessageConfiguration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.SendMessageConfiguration buildPartial() { + io.a2a.grpc.SendMessageConfiguration result = new io.a2a.grpc.SendMessageConfiguration(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.SendMessageConfiguration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + acceptedOutputModes_.makeImmutable(); + result.acceptedOutputModes_ = acceptedOutputModes_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pushNotification_ = pushNotificationBuilder_ == null + ? pushNotification_ + : pushNotificationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.historyLength_ = historyLength_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.blocking_ = blocking_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.SendMessageConfiguration) { + return mergeFrom((io.a2a.grpc.SendMessageConfiguration)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.SendMessageConfiguration other) { + if (other == io.a2a.grpc.SendMessageConfiguration.getDefaultInstance()) return this; + if (!other.acceptedOutputModes_.isEmpty()) { + if (acceptedOutputModes_.isEmpty()) { + acceptedOutputModes_ = other.acceptedOutputModes_; + bitField0_ |= 0x00000001; + } else { + ensureAcceptedOutputModesIsMutable(); + acceptedOutputModes_.addAll(other.acceptedOutputModes_); + } + onChanged(); + } + if (other.hasPushNotification()) { + mergePushNotification(other.getPushNotification()); + } + if (other.getHistoryLength() != 0) { + setHistoryLength(other.getHistoryLength()); + } + if (other.getBlocking() != false) { + setBlocking(other.getBlocking()); + } + 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: { + java.lang.String s = input.readStringRequireUtf8(); + ensureAcceptedOutputModesIsMutable(); + acceptedOutputModes_.add(s); + break; + } // case 10 + case 18: { + input.readMessage( + internalGetPushNotificationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: { + historyLength_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + blocking_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 com.google.protobuf.LazyStringArrayList acceptedOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureAcceptedOutputModesIsMutable() { + if (!acceptedOutputModes_.isModifiable()) { + acceptedOutputModes_ = new com.google.protobuf.LazyStringArrayList(acceptedOutputModes_); + } + bitField0_ |= 0x00000001; + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return A list containing the acceptedOutputModes. + */ + public com.google.protobuf.ProtocolStringList + getAcceptedOutputModesList() { + acceptedOutputModes_.makeImmutable(); + return acceptedOutputModes_; + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return The count of acceptedOutputModes. + */ + public int getAcceptedOutputModesCount() { + return acceptedOutputModes_.size(); + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index of the element to return. + * @return The acceptedOutputModes at the given index. + */ + public java.lang.String getAcceptedOutputModes(int index) { + return acceptedOutputModes_.get(index); + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index of the value to return. + * @return The bytes of the acceptedOutputModes at the given index. + */ + public com.google.protobuf.ByteString + getAcceptedOutputModesBytes(int index) { + return acceptedOutputModes_.getByteString(index); + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index to set the value at. + * @param value The acceptedOutputModes to set. + * @return This builder for chaining. + */ + public Builder setAcceptedOutputModes( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureAcceptedOutputModesIsMutable(); + acceptedOutputModes_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param value The acceptedOutputModes to add. + * @return This builder for chaining. + */ + public Builder addAcceptedOutputModes( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureAcceptedOutputModesIsMutable(); + acceptedOutputModes_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param values The acceptedOutputModes to add. + * @return This builder for chaining. + */ + public Builder addAllAcceptedOutputModes( + java.lang.Iterable values) { + ensureAcceptedOutputModesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, acceptedOutputModes_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return This builder for chaining. + */ + public Builder clearAcceptedOutputModes() { + acceptedOutputModes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + *
+     * The output modes that the agent is expected to respond with.
+     * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param value The bytes of the acceptedOutputModes to add. + * @return This builder for chaining. + */ + public Builder addAcceptedOutputModesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureAcceptedOutputModesIsMutable(); + acceptedOutputModes_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private io.a2a.grpc.PushNotificationConfig pushNotification_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PushNotificationConfig, io.a2a.grpc.PushNotificationConfig.Builder, io.a2a.grpc.PushNotificationConfigOrBuilder> pushNotificationBuilder_; + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + * @return Whether the pushNotification field is set. + */ + public boolean hasPushNotification() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + * @return The pushNotification. + */ + public io.a2a.grpc.PushNotificationConfig getPushNotification() { + if (pushNotificationBuilder_ == null) { + return pushNotification_ == null ? io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotification_; + } else { + return pushNotificationBuilder_.getMessage(); + } + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + public Builder setPushNotification(io.a2a.grpc.PushNotificationConfig value) { + if (pushNotificationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pushNotification_ = value; + } else { + pushNotificationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + public Builder setPushNotification( + io.a2a.grpc.PushNotificationConfig.Builder builderForValue) { + if (pushNotificationBuilder_ == null) { + pushNotification_ = builderForValue.build(); + } else { + pushNotificationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + public Builder mergePushNotification(io.a2a.grpc.PushNotificationConfig value) { + if (pushNotificationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + pushNotification_ != null && + pushNotification_ != io.a2a.grpc.PushNotificationConfig.getDefaultInstance()) { + getPushNotificationBuilder().mergeFrom(value); + } else { + pushNotification_ = value; + } + } else { + pushNotificationBuilder_.mergeFrom(value); + } + if (pushNotification_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + public Builder clearPushNotification() { + bitField0_ = (bitField0_ & ~0x00000002); + pushNotification_ = null; + if (pushNotificationBuilder_ != null) { + pushNotificationBuilder_.dispose(); + pushNotificationBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + public io.a2a.grpc.PushNotificationConfig.Builder getPushNotificationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPushNotificationFieldBuilder().getBuilder(); + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + public io.a2a.grpc.PushNotificationConfigOrBuilder getPushNotificationOrBuilder() { + if (pushNotificationBuilder_ != null) { + return pushNotificationBuilder_.getMessageOrBuilder(); + } else { + return pushNotification_ == null ? + io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotification_; + } + } + /** + *
+     * A configuration of a webhook that can be used to receive updates
+     * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PushNotificationConfig, io.a2a.grpc.PushNotificationConfig.Builder, io.a2a.grpc.PushNotificationConfigOrBuilder> + internalGetPushNotificationFieldBuilder() { + if (pushNotificationBuilder_ == null) { + pushNotificationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PushNotificationConfig, io.a2a.grpc.PushNotificationConfig.Builder, io.a2a.grpc.PushNotificationConfigOrBuilder>( + getPushNotification(), + getParentForChildren(), + isClean()); + pushNotification_ = null; + } + return pushNotificationBuilder_; + } + + private int historyLength_ ; + /** + *
+     * The maximum number of messages to include in the history. if 0, the
+     * history will be unlimited.
+     * 
+ * + * int32 history_length = 3 [json_name = "historyLength"]; + * @return The historyLength. + */ + @java.lang.Override + public int getHistoryLength() { + return historyLength_; + } + /** + *
+     * The maximum number of messages to include in the history. if 0, the
+     * history will be unlimited.
+     * 
+ * + * int32 history_length = 3 [json_name = "historyLength"]; + * @param value The historyLength to set. + * @return This builder for chaining. + */ + public Builder setHistoryLength(int value) { + + historyLength_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The maximum number of messages to include in the history. if 0, the
+     * history will be unlimited.
+     * 
+ * + * int32 history_length = 3 [json_name = "historyLength"]; + * @return This builder for chaining. + */ + public Builder clearHistoryLength() { + bitField0_ = (bitField0_ & ~0x00000004); + historyLength_ = 0; + onChanged(); + return this; + } + + private boolean blocking_ ; + /** + *
+     * If true, the message will be blocking until the task is completed. If
+     * false, the message will be non-blocking and the task will be returned
+     * immediately. It is the caller's responsibility to check for any task
+     * updates.
+     * 
+ * + * bool blocking = 4 [json_name = "blocking"]; + * @return The blocking. + */ + @java.lang.Override + public boolean getBlocking() { + return blocking_; + } + /** + *
+     * If true, the message will be blocking until the task is completed. If
+     * false, the message will be non-blocking and the task will be returned
+     * immediately. It is the caller's responsibility to check for any task
+     * updates.
+     * 
+ * + * bool blocking = 4 [json_name = "blocking"]; + * @param value The blocking to set. + * @return This builder for chaining. + */ + public Builder setBlocking(boolean value) { + + blocking_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * If true, the message will be blocking until the task is completed. If
+     * false, the message will be non-blocking and the task will be returned
+     * immediately. It is the caller's responsibility to check for any task
+     * updates.
+     * 
+ * + * bool blocking = 4 [json_name = "blocking"]; + * @return This builder for chaining. + */ + public Builder clearBlocking() { + bitField0_ = (bitField0_ & ~0x00000008); + blocking_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.SendMessageConfiguration) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.SendMessageConfiguration) + private static final io.a2a.grpc.SendMessageConfiguration DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.SendMessageConfiguration(); + } + + public static io.a2a.grpc.SendMessageConfiguration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendMessageConfiguration 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 io.a2a.grpc.SendMessageConfiguration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/SendMessageConfigurationOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/SendMessageConfigurationOrBuilder.java new file mode 100644 index 000000000..7df0eb45a --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SendMessageConfigurationOrBuilder.java @@ -0,0 +1,104 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface SendMessageConfigurationOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.SendMessageConfiguration) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return A list containing the acceptedOutputModes. + */ + java.util.List + getAcceptedOutputModesList(); + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @return The count of acceptedOutputModes. + */ + int getAcceptedOutputModesCount(); + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index of the element to return. + * @return The acceptedOutputModes at the given index. + */ + java.lang.String getAcceptedOutputModes(int index); + /** + *
+   * The output modes that the agent is expected to respond with.
+   * 
+ * + * repeated string accepted_output_modes = 1 [json_name = "acceptedOutputModes"]; + * @param index The index of the value to return. + * @return The bytes of the acceptedOutputModes at the given index. + */ + com.google.protobuf.ByteString + getAcceptedOutputModesBytes(int index); + + /** + *
+   * A configuration of a webhook that can be used to receive updates
+   * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + * @return Whether the pushNotification field is set. + */ + boolean hasPushNotification(); + /** + *
+   * A configuration of a webhook that can be used to receive updates
+   * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + * @return The pushNotification. + */ + io.a2a.grpc.PushNotificationConfig getPushNotification(); + /** + *
+   * A configuration of a webhook that can be used to receive updates
+   * 
+ * + * .a2a.v1.PushNotificationConfig push_notification = 2 [json_name = "pushNotification"]; + */ + io.a2a.grpc.PushNotificationConfigOrBuilder getPushNotificationOrBuilder(); + + /** + *
+   * The maximum number of messages to include in the history. if 0, the
+   * history will be unlimited.
+   * 
+ * + * int32 history_length = 3 [json_name = "historyLength"]; + * @return The historyLength. + */ + int getHistoryLength(); + + /** + *
+   * If true, the message will be blocking until the task is completed. If
+   * false, the message will be non-blocking and the task will be returned
+   * immediately. It is the caller's responsibility to check for any task
+   * updates.
+   * 
+ * + * bool blocking = 4 [json_name = "blocking"]; + * @return The blocking. + */ + boolean getBlocking(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/SendMessageRequest.java b/grpc/src/main/java/io/a2a/grpc/SendMessageRequest.java new file mode 100644 index 000000000..7b3c9cb87 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SendMessageRequest.java @@ -0,0 +1,937 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * /////////// Request Messages ///////////
+ * 
+ * + * Protobuf type {@code a2a.v1.SendMessageRequest} + */ +@com.google.protobuf.Generated +public final class SendMessageRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.SendMessageRequest) + SendMessageRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + SendMessageRequest.class.getName()); + } + // Use SendMessageRequest.newBuilder() to construct. + private SendMessageRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SendMessageRequest() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SendMessageRequest.class, io.a2a.grpc.SendMessageRequest.Builder.class); + } + + private int bitField0_; + public static final int REQUEST_FIELD_NUMBER = 1; + private io.a2a.grpc.Message request_; + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + * @return The request. + */ + @java.lang.Override + public io.a2a.grpc.Message getRequest() { + return request_ == null ? io.a2a.grpc.Message.getDefaultInstance() : request_; + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getRequestOrBuilder() { + return request_ == null ? io.a2a.grpc.Message.getDefaultInstance() : request_; + } + + public static final int CONFIGURATION_FIELD_NUMBER = 2; + private io.a2a.grpc.SendMessageConfiguration configuration_; + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + * @return Whether the configuration field is set. + */ + @java.lang.Override + public boolean hasConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + * @return The configuration. + */ + @java.lang.Override + public io.a2a.grpc.SendMessageConfiguration getConfiguration() { + return configuration_ == null ? io.a2a.grpc.SendMessageConfiguration.getDefaultInstance() : configuration_; + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + @java.lang.Override + public io.a2a.grpc.SendMessageConfigurationOrBuilder getConfigurationOrBuilder() { + return configuration_ == null ? io.a2a.grpc.SendMessageConfiguration.getDefaultInstance() : configuration_; + } + + public static final int METADATA_FIELD_NUMBER = 3; + private com.google.protobuf.Struct metadata_; + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getConfiguration()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMetadata()); + } + 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 io.a2a.grpc.SendMessageRequest)) { + return super.equals(obj); + } + io.a2a.grpc.SendMessageRequest other = (io.a2a.grpc.SendMessageRequest) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (hasConfiguration() != other.hasConfiguration()) return false; + if (hasConfiguration()) { + if (!getConfiguration() + .equals(other.getConfiguration())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + if (hasConfiguration()) { + hash = (37 * hash) + CONFIGURATION_FIELD_NUMBER; + hash = (53 * hash) + getConfiguration().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.SendMessageRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.SendMessageRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.SendMessageRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SendMessageRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.SendMessageRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * /////////// Request Messages ///////////
+   * 
+ * + * Protobuf type {@code a2a.v1.SendMessageRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.SendMessageRequest) + io.a2a.grpc.SendMessageRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SendMessageRequest.class, io.a2a.grpc.SendMessageRequest.Builder.class); + } + + // Construct using io.a2a.grpc.SendMessageRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetRequestFieldBuilder(); + internalGetConfigurationFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + configuration_ = null; + if (configurationBuilder_ != null) { + configurationBuilder_.dispose(); + configurationBuilder_ = null; + } + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.SendMessageRequest getDefaultInstanceForType() { + return io.a2a.grpc.SendMessageRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.SendMessageRequest build() { + io.a2a.grpc.SendMessageRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.SendMessageRequest buildPartial() { + io.a2a.grpc.SendMessageRequest result = new io.a2a.grpc.SendMessageRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.SendMessageRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.request_ = requestBuilder_ == null + ? request_ + : requestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.configuration_ = configurationBuilder_ == null + ? configuration_ + : configurationBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metadata_ = metadataBuilder_ == null + ? metadata_ + : metadataBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.SendMessageRequest) { + return mergeFrom((io.a2a.grpc.SendMessageRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.SendMessageRequest other) { + if (other == io.a2a.grpc.SendMessageRequest.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.hasConfiguration()) { + mergeConfiguration(other.getConfiguration()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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: { + input.readMessage( + internalGetRequestFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetConfigurationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + 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 io.a2a.grpc.Message request_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> requestBuilder_; + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + * @return The request. + */ + public io.a2a.grpc.Message getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? io.a2a.grpc.Message.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder setRequest(io.a2a.grpc.Message value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder setRequest( + io.a2a.grpc.Message.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeRequest(io.a2a.grpc.Message value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + request_ != null && + request_ != io.a2a.grpc.Message.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + public io.a2a.grpc.Message.Builder getRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRequestFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + public io.a2a.grpc.MessageOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + io.a2a.grpc.Message.getDefaultInstance() : request_; + } + } + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> + internalGetRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + + private io.a2a.grpc.SendMessageConfiguration configuration_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.SendMessageConfiguration, io.a2a.grpc.SendMessageConfiguration.Builder, io.a2a.grpc.SendMessageConfigurationOrBuilder> configurationBuilder_; + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + * @return Whether the configuration field is set. + */ + public boolean hasConfiguration() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + * @return The configuration. + */ + public io.a2a.grpc.SendMessageConfiguration getConfiguration() { + if (configurationBuilder_ == null) { + return configuration_ == null ? io.a2a.grpc.SendMessageConfiguration.getDefaultInstance() : configuration_; + } else { + return configurationBuilder_.getMessage(); + } + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + public Builder setConfiguration(io.a2a.grpc.SendMessageConfiguration value) { + if (configurationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + configuration_ = value; + } else { + configurationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + public Builder setConfiguration( + io.a2a.grpc.SendMessageConfiguration.Builder builderForValue) { + if (configurationBuilder_ == null) { + configuration_ = builderForValue.build(); + } else { + configurationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + public Builder mergeConfiguration(io.a2a.grpc.SendMessageConfiguration value) { + if (configurationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + configuration_ != null && + configuration_ != io.a2a.grpc.SendMessageConfiguration.getDefaultInstance()) { + getConfigurationBuilder().mergeFrom(value); + } else { + configuration_ = value; + } + } else { + configurationBuilder_.mergeFrom(value); + } + if (configuration_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + public Builder clearConfiguration() { + bitField0_ = (bitField0_ & ~0x00000002); + configuration_ = null; + if (configurationBuilder_ != null) { + configurationBuilder_.dispose(); + configurationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + public io.a2a.grpc.SendMessageConfiguration.Builder getConfigurationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetConfigurationFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + public io.a2a.grpc.SendMessageConfigurationOrBuilder getConfigurationOrBuilder() { + if (configurationBuilder_ != null) { + return configurationBuilder_.getMessageOrBuilder(); + } else { + return configuration_ == null ? + io.a2a.grpc.SendMessageConfiguration.getDefaultInstance() : configuration_; + } + } + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.SendMessageConfiguration, io.a2a.grpc.SendMessageConfiguration.Builder, io.a2a.grpc.SendMessageConfigurationOrBuilder> + internalGetConfigurationFieldBuilder() { + if (configurationBuilder_ == null) { + configurationBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.SendMessageConfiguration, io.a2a.grpc.SendMessageConfiguration.Builder, io.a2a.grpc.SendMessageConfigurationOrBuilder>( + getConfiguration(), + getParentForChildren(), + isClean()); + configuration_ = null; + } + return configurationBuilder_; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + public Builder setMetadata( + com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + metadata_ != null && + metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000004); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.SendMessageRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.SendMessageRequest) + private static final io.a2a.grpc.SendMessageRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.SendMessageRequest(); + } + + public static io.a2a.grpc.SendMessageRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendMessageRequest 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 io.a2a.grpc.SendMessageRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/SendMessageRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/SendMessageRequestOrBuilder.java new file mode 100644 index 000000000..824622db1 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SendMessageRequestOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface SendMessageRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.SendMessageRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + * @return The request. + */ + io.a2a.grpc.Message getRequest(); + /** + * .a2a.v1.Message request = 1 [json_name = "request", (.google.api.field_behavior) = REQUIRED]; + */ + io.a2a.grpc.MessageOrBuilder getRequestOrBuilder(); + + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + * @return Whether the configuration field is set. + */ + boolean hasConfiguration(); + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + * @return The configuration. + */ + io.a2a.grpc.SendMessageConfiguration getConfiguration(); + /** + * .a2a.v1.SendMessageConfiguration configuration = 2 [json_name = "configuration"]; + */ + io.a2a.grpc.SendMessageConfigurationOrBuilder getConfigurationOrBuilder(); + + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + * .google.protobuf.Struct metadata = 3 [json_name = "metadata"]; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/SendMessageResponse.java b/grpc/src/main/java/io/a2a/grpc/SendMessageResponse.java new file mode 100644 index 000000000..fbad3f50e --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SendMessageResponse.java @@ -0,0 +1,865 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * ////// Response Messages ///////////
+ * 
+ * + * Protobuf type {@code a2a.v1.SendMessageResponse} + */ +@com.google.protobuf.Generated +public final class SendMessageResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.SendMessageResponse) + SendMessageResponseOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + SendMessageResponse.class.getName()); + } + // Use SendMessageResponse.newBuilder() to construct. + private SendMessageResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SendMessageResponse() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SendMessageResponse.class, io.a2a.grpc.SendMessageResponse.Builder.class); + } + + private int payloadCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object payload_; + public enum PayloadCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TASK(1), + MSG(2), + PAYLOAD_NOT_SET(0); + private final int value; + private PayloadCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: return TASK; + case 2: return MSG; + case 0: return PAYLOAD_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public static final int TASK_FIELD_NUMBER = 1; + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return Whether the task field is set. + */ + @java.lang.Override + public boolean hasTask() { + return payloadCase_ == 1; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return The task. + */ + @java.lang.Override + public io.a2a.grpc.Task getTask() { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskOrBuilder getTaskOrBuilder() { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + + public static final int MSG_FIELD_NUMBER = 2; + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return Whether the msg field is set. + */ + @java.lang.Override + public boolean hasMsg() { + return payloadCase_ == 2; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return The msg. + */ + @java.lang.Override + public io.a2a.grpc.Message getMsg() { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getMsgOrBuilder() { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (io.a2a.grpc.Task) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (io.a2a.grpc.Message) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.a2a.grpc.Task) payload_); + } + if (payloadCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (io.a2a.grpc.Message) payload_); + } + 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 io.a2a.grpc.SendMessageResponse)) { + return super.equals(obj); + } + io.a2a.grpc.SendMessageResponse other = (io.a2a.grpc.SendMessageResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getTask() + .equals(other.getTask())) return false; + break; + case 2: + if (!getMsg() + .equals(other.getMsg())) return false; + break; + case 0: + default: + } + 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(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + TASK_FIELD_NUMBER; + hash = (53 * hash) + getTask().hashCode(); + break; + case 2: + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.SendMessageResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.SendMessageResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.SendMessageResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.SendMessageResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.SendMessageResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.SendMessageResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * ////// Response Messages ///////////
+   * 
+ * + * Protobuf type {@code a2a.v1.SendMessageResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.SendMessageResponse) + io.a2a.grpc.SendMessageResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.SendMessageResponse.class, io.a2a.grpc.SendMessageResponse.Builder.class); + } + + // Construct using io.a2a.grpc.SendMessageResponse.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (taskBuilder_ != null) { + taskBuilder_.clear(); + } + if (msgBuilder_ != null) { + msgBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_SendMessageResponse_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.SendMessageResponse getDefaultInstanceForType() { + return io.a2a.grpc.SendMessageResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.SendMessageResponse build() { + io.a2a.grpc.SendMessageResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.SendMessageResponse buildPartial() { + io.a2a.grpc.SendMessageResponse result = new io.a2a.grpc.SendMessageResponse(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.SendMessageResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(io.a2a.grpc.SendMessageResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && + taskBuilder_ != null) { + result.payload_ = taskBuilder_.build(); + } + if (payloadCase_ == 2 && + msgBuilder_ != null) { + result.payload_ = msgBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.SendMessageResponse) { + return mergeFrom((io.a2a.grpc.SendMessageResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.SendMessageResponse other) { + if (other == io.a2a.grpc.SendMessageResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case TASK: { + mergeTask(other.getTask()); + break; + } + case MSG: { + mergeMsg(other.getMsg()); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + 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: { + input.readMessage( + internalGetTaskFieldBuilder().getBuilder(), + extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetMsgFieldBuilder().getBuilder(), + extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + 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 payloadCase_ = 0; + private java.lang.Object payload_; + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Task, io.a2a.grpc.Task.Builder, io.a2a.grpc.TaskOrBuilder> taskBuilder_; + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return Whether the task field is set. + */ + @java.lang.Override + public boolean hasTask() { + return payloadCase_ == 1; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return The task. + */ + @java.lang.Override + public io.a2a.grpc.Task getTask() { + if (taskBuilder_ == null) { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return taskBuilder_.getMessage(); + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder setTask(io.a2a.grpc.Task value) { + if (taskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + taskBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder setTask( + io.a2a.grpc.Task.Builder builderForValue) { + if (taskBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + taskBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder mergeTask(io.a2a.grpc.Task value) { + if (taskBuilder_ == null) { + if (payloadCase_ == 1 && + payload_ != io.a2a.grpc.Task.getDefaultInstance()) { + payload_ = io.a2a.grpc.Task.newBuilder((io.a2a.grpc.Task) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + taskBuilder_.mergeFrom(value); + } else { + taskBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder clearTask() { + if (taskBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + taskBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public io.a2a.grpc.Task.Builder getTaskBuilder() { + return internalGetTaskFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskOrBuilder getTaskOrBuilder() { + if ((payloadCase_ == 1) && (taskBuilder_ != null)) { + return taskBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Task, io.a2a.grpc.Task.Builder, io.a2a.grpc.TaskOrBuilder> + internalGetTaskFieldBuilder() { + if (taskBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = io.a2a.grpc.Task.getDefaultInstance(); + } + taskBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Task, io.a2a.grpc.Task.Builder, io.a2a.grpc.TaskOrBuilder>( + (io.a2a.grpc.Task) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return taskBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> msgBuilder_; + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return Whether the msg field is set. + */ + @java.lang.Override + public boolean hasMsg() { + return payloadCase_ == 2; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return The msg. + */ + @java.lang.Override + public io.a2a.grpc.Message getMsg() { + if (msgBuilder_ == null) { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return msgBuilder_.getMessage(); + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder setMsg(io.a2a.grpc.Message value) { + if (msgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + msgBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder setMsg( + io.a2a.grpc.Message.Builder builderForValue) { + if (msgBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + msgBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder mergeMsg(io.a2a.grpc.Message value) { + if (msgBuilder_ == null) { + if (payloadCase_ == 2 && + payload_ != io.a2a.grpc.Message.getDefaultInstance()) { + payload_ = io.a2a.grpc.Message.newBuilder((io.a2a.grpc.Message) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + msgBuilder_.mergeFrom(value); + } else { + msgBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder clearMsg() { + if (msgBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + msgBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public io.a2a.grpc.Message.Builder getMsgBuilder() { + return internalGetMsgFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getMsgOrBuilder() { + if ((payloadCase_ == 2) && (msgBuilder_ != null)) { + return msgBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> + internalGetMsgFieldBuilder() { + if (msgBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = io.a2a.grpc.Message.getDefaultInstance(); + } + msgBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder>( + (io.a2a.grpc.Message) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return msgBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.SendMessageResponse) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.SendMessageResponse) + private static final io.a2a.grpc.SendMessageResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.SendMessageResponse(); + } + + public static io.a2a.grpc.SendMessageResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendMessageResponse 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 io.a2a.grpc.SendMessageResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/SendMessageResponseOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/SendMessageResponseOrBuilder.java new file mode 100644 index 000000000..b0032bac7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/SendMessageResponseOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface SendMessageResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.SendMessageResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return Whether the task field is set. + */ + boolean hasTask(); + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return The task. + */ + io.a2a.grpc.Task getTask(); + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + io.a2a.grpc.TaskOrBuilder getTaskOrBuilder(); + + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return Whether the msg field is set. + */ + boolean hasMsg(); + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return The msg. + */ + io.a2a.grpc.Message getMsg(); + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + io.a2a.grpc.MessageOrBuilder getMsgOrBuilder(); + + io.a2a.grpc.SendMessageResponse.PayloadCase getPayloadCase(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/StreamResponse.java b/grpc/src/main/java/io/a2a/grpc/StreamResponse.java new file mode 100644 index 000000000..f9a76e2a7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/StreamResponse.java @@ -0,0 +1,1297 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * The stream response for a message. The stream should be one of the following
+ * sequences:
+ * If the response is a message, the stream should contain one, and only one,
+ * message and then close
+ * If the response is a task lifecycle, the first response should be a Task
+ * object followed by zero or more TaskStatusUpdateEvents and
+ * TaskArtifactUpdateEvents. The stream should complete when the Task
+ * if in an interrupted or terminal state. A stream that ends before these
+ * conditions are met are
+ * 
+ * + * Protobuf type {@code a2a.v1.StreamResponse} + */ +@com.google.protobuf.Generated +public final class StreamResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.StreamResponse) + StreamResponseOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + StreamResponse.class.getName()); + } + // Use StreamResponse.newBuilder() to construct. + private StreamResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StreamResponse() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StreamResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StreamResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.StreamResponse.class, io.a2a.grpc.StreamResponse.Builder.class); + } + + private int payloadCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object payload_; + public enum PayloadCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TASK(1), + MSG(2), + STATUS_UPDATE(3), + ARTIFACT_UPDATE(4), + PAYLOAD_NOT_SET(0); + private final int value; + private PayloadCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PayloadCase valueOf(int value) { + return forNumber(value); + } + + public static PayloadCase forNumber(int value) { + switch (value) { + case 1: return TASK; + case 2: return MSG; + case 3: return STATUS_UPDATE; + case 4: return ARTIFACT_UPDATE; + case 0: return PAYLOAD_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public static final int TASK_FIELD_NUMBER = 1; + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return Whether the task field is set. + */ + @java.lang.Override + public boolean hasTask() { + return payloadCase_ == 1; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return The task. + */ + @java.lang.Override + public io.a2a.grpc.Task getTask() { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskOrBuilder getTaskOrBuilder() { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + + public static final int MSG_FIELD_NUMBER = 2; + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return Whether the msg field is set. + */ + @java.lang.Override + public boolean hasMsg() { + return payloadCase_ == 2; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return The msg. + */ + @java.lang.Override + public io.a2a.grpc.Message getMsg() { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getMsgOrBuilder() { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + + public static final int STATUS_UPDATE_FIELD_NUMBER = 3; + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + * @return Whether the statusUpdate field is set. + */ + @java.lang.Override + public boolean hasStatusUpdate() { + return payloadCase_ == 3; + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + * @return The statusUpdate. + */ + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEvent getStatusUpdate() { + if (payloadCase_ == 3) { + return (io.a2a.grpc.TaskStatusUpdateEvent) payload_; + } + return io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEventOrBuilder getStatusUpdateOrBuilder() { + if (payloadCase_ == 3) { + return (io.a2a.grpc.TaskStatusUpdateEvent) payload_; + } + return io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } + + public static final int ARTIFACT_UPDATE_FIELD_NUMBER = 4; + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + * @return Whether the artifactUpdate field is set. + */ + @java.lang.Override + public boolean hasArtifactUpdate() { + return payloadCase_ == 4; + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + * @return The artifactUpdate. + */ + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEvent getArtifactUpdate() { + if (payloadCase_ == 4) { + return (io.a2a.grpc.TaskArtifactUpdateEvent) payload_; + } + return io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEventOrBuilder getArtifactUpdateOrBuilder() { + if (payloadCase_ == 4) { + return (io.a2a.grpc.TaskArtifactUpdateEvent) payload_; + } + return io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } + + 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 (payloadCase_ == 1) { + output.writeMessage(1, (io.a2a.grpc.Task) payload_); + } + if (payloadCase_ == 2) { + output.writeMessage(2, (io.a2a.grpc.Message) payload_); + } + if (payloadCase_ == 3) { + output.writeMessage(3, (io.a2a.grpc.TaskStatusUpdateEvent) payload_); + } + if (payloadCase_ == 4) { + output.writeMessage(4, (io.a2a.grpc.TaskArtifactUpdateEvent) payload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (payloadCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.a2a.grpc.Task) payload_); + } + if (payloadCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (io.a2a.grpc.Message) payload_); + } + if (payloadCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (io.a2a.grpc.TaskStatusUpdateEvent) payload_); + } + if (payloadCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (io.a2a.grpc.TaskArtifactUpdateEvent) payload_); + } + 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 io.a2a.grpc.StreamResponse)) { + return super.equals(obj); + } + io.a2a.grpc.StreamResponse other = (io.a2a.grpc.StreamResponse) obj; + + if (!getPayloadCase().equals(other.getPayloadCase())) return false; + switch (payloadCase_) { + case 1: + if (!getTask() + .equals(other.getTask())) return false; + break; + case 2: + if (!getMsg() + .equals(other.getMsg())) return false; + break; + case 3: + if (!getStatusUpdate() + .equals(other.getStatusUpdate())) return false; + break; + case 4: + if (!getArtifactUpdate() + .equals(other.getArtifactUpdate())) return false; + break; + case 0: + default: + } + 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(); + switch (payloadCase_) { + case 1: + hash = (37 * hash) + TASK_FIELD_NUMBER; + hash = (53 * hash) + getTask().hashCode(); + break; + case 2: + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + break; + case 3: + hash = (37 * hash) + STATUS_UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getStatusUpdate().hashCode(); + break; + case 4: + hash = (37 * hash) + ARTIFACT_UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getArtifactUpdate().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.StreamResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.StreamResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.StreamResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.StreamResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.StreamResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.StreamResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.StreamResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.StreamResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.StreamResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.StreamResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.StreamResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.StreamResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.StreamResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The stream response for a message. The stream should be one of the following
+   * sequences:
+   * If the response is a message, the stream should contain one, and only one,
+   * message and then close
+   * If the response is a task lifecycle, the first response should be a Task
+   * object followed by zero or more TaskStatusUpdateEvents and
+   * TaskArtifactUpdateEvents. The stream should complete when the Task
+   * if in an interrupted or terminal state. A stream that ends before these
+   * conditions are met are
+   * 
+ * + * Protobuf type {@code a2a.v1.StreamResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.StreamResponse) + io.a2a.grpc.StreamResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StreamResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StreamResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.StreamResponse.class, io.a2a.grpc.StreamResponse.Builder.class); + } + + // Construct using io.a2a.grpc.StreamResponse.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (taskBuilder_ != null) { + taskBuilder_.clear(); + } + if (msgBuilder_ != null) { + msgBuilder_.clear(); + } + if (statusUpdateBuilder_ != null) { + statusUpdateBuilder_.clear(); + } + if (artifactUpdateBuilder_ != null) { + artifactUpdateBuilder_.clear(); + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StreamResponse_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.StreamResponse getDefaultInstanceForType() { + return io.a2a.grpc.StreamResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.StreamResponse build() { + io.a2a.grpc.StreamResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.StreamResponse buildPartial() { + io.a2a.grpc.StreamResponse result = new io.a2a.grpc.StreamResponse(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.StreamResponse result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(io.a2a.grpc.StreamResponse result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 1 && + taskBuilder_ != null) { + result.payload_ = taskBuilder_.build(); + } + if (payloadCase_ == 2 && + msgBuilder_ != null) { + result.payload_ = msgBuilder_.build(); + } + if (payloadCase_ == 3 && + statusUpdateBuilder_ != null) { + result.payload_ = statusUpdateBuilder_.build(); + } + if (payloadCase_ == 4 && + artifactUpdateBuilder_ != null) { + result.payload_ = artifactUpdateBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.StreamResponse) { + return mergeFrom((io.a2a.grpc.StreamResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.StreamResponse other) { + if (other == io.a2a.grpc.StreamResponse.getDefaultInstance()) return this; + switch (other.getPayloadCase()) { + case TASK: { + mergeTask(other.getTask()); + break; + } + case MSG: { + mergeMsg(other.getMsg()); + break; + } + case STATUS_UPDATE: { + mergeStatusUpdate(other.getStatusUpdate()); + break; + } + case ARTIFACT_UPDATE: { + mergeArtifactUpdate(other.getArtifactUpdate()); + break; + } + case PAYLOAD_NOT_SET: { + break; + } + } + 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: { + input.readMessage( + internalGetTaskFieldBuilder().getBuilder(), + extensionRegistry); + payloadCase_ = 1; + break; + } // case 10 + case 18: { + input.readMessage( + internalGetMsgFieldBuilder().getBuilder(), + extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetStatusUpdateFieldBuilder().getBuilder(), + extensionRegistry); + payloadCase_ = 3; + break; + } // case 26 + case 34: { + input.readMessage( + internalGetArtifactUpdateFieldBuilder().getBuilder(), + extensionRegistry); + payloadCase_ = 4; + break; + } // case 34 + 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 payloadCase_ = 0; + private java.lang.Object payload_; + public PayloadCase + getPayloadCase() { + return PayloadCase.forNumber( + payloadCase_); + } + + public Builder clearPayload() { + payloadCase_ = 0; + payload_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Task, io.a2a.grpc.Task.Builder, io.a2a.grpc.TaskOrBuilder> taskBuilder_; + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return Whether the task field is set. + */ + @java.lang.Override + public boolean hasTask() { + return payloadCase_ == 1; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return The task. + */ + @java.lang.Override + public io.a2a.grpc.Task getTask() { + if (taskBuilder_ == null) { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } else { + if (payloadCase_ == 1) { + return taskBuilder_.getMessage(); + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder setTask(io.a2a.grpc.Task value) { + if (taskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + taskBuilder_.setMessage(value); + } + payloadCase_ = 1; + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder setTask( + io.a2a.grpc.Task.Builder builderForValue) { + if (taskBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + taskBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 1; + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder mergeTask(io.a2a.grpc.Task value) { + if (taskBuilder_ == null) { + if (payloadCase_ == 1 && + payload_ != io.a2a.grpc.Task.getDefaultInstance()) { + payload_ = io.a2a.grpc.Task.newBuilder((io.a2a.grpc.Task) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 1) { + taskBuilder_.mergeFrom(value); + } else { + taskBuilder_.setMessage(value); + } + } + payloadCase_ = 1; + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public Builder clearTask() { + if (taskBuilder_ == null) { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 1) { + payloadCase_ = 0; + payload_ = null; + } + taskBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + public io.a2a.grpc.Task.Builder getTaskBuilder() { + return internalGetTaskFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskOrBuilder getTaskOrBuilder() { + if ((payloadCase_ == 1) && (taskBuilder_ != null)) { + return taskBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 1) { + return (io.a2a.grpc.Task) payload_; + } + return io.a2a.grpc.Task.getDefaultInstance(); + } + } + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Task, io.a2a.grpc.Task.Builder, io.a2a.grpc.TaskOrBuilder> + internalGetTaskFieldBuilder() { + if (taskBuilder_ == null) { + if (!(payloadCase_ == 1)) { + payload_ = io.a2a.grpc.Task.getDefaultInstance(); + } + taskBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Task, io.a2a.grpc.Task.Builder, io.a2a.grpc.TaskOrBuilder>( + (io.a2a.grpc.Task) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 1; + onChanged(); + return taskBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> msgBuilder_; + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return Whether the msg field is set. + */ + @java.lang.Override + public boolean hasMsg() { + return payloadCase_ == 2; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return The msg. + */ + @java.lang.Override + public io.a2a.grpc.Message getMsg() { + if (msgBuilder_ == null) { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } else { + if (payloadCase_ == 2) { + return msgBuilder_.getMessage(); + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder setMsg(io.a2a.grpc.Message value) { + if (msgBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + msgBuilder_.setMessage(value); + } + payloadCase_ = 2; + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder setMsg( + io.a2a.grpc.Message.Builder builderForValue) { + if (msgBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + msgBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 2; + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder mergeMsg(io.a2a.grpc.Message value) { + if (msgBuilder_ == null) { + if (payloadCase_ == 2 && + payload_ != io.a2a.grpc.Message.getDefaultInstance()) { + payload_ = io.a2a.grpc.Message.newBuilder((io.a2a.grpc.Message) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 2) { + msgBuilder_.mergeFrom(value); + } else { + msgBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public Builder clearMsg() { + if (msgBuilder_ == null) { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 2) { + payloadCase_ = 0; + payload_ = null; + } + msgBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + public io.a2a.grpc.Message.Builder getMsgBuilder() { + return internalGetMsgFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getMsgOrBuilder() { + if ((payloadCase_ == 2) && (msgBuilder_ != null)) { + return msgBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 2) { + return (io.a2a.grpc.Message) payload_; + } + return io.a2a.grpc.Message.getDefaultInstance(); + } + } + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> + internalGetMsgFieldBuilder() { + if (msgBuilder_ == null) { + if (!(payloadCase_ == 2)) { + payload_ = io.a2a.grpc.Message.getDefaultInstance(); + } + msgBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder>( + (io.a2a.grpc.Message) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 2; + onChanged(); + return msgBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatusUpdateEvent, io.a2a.grpc.TaskStatusUpdateEvent.Builder, io.a2a.grpc.TaskStatusUpdateEventOrBuilder> statusUpdateBuilder_; + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + * @return Whether the statusUpdate field is set. + */ + @java.lang.Override + public boolean hasStatusUpdate() { + return payloadCase_ == 3; + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + * @return The statusUpdate. + */ + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEvent getStatusUpdate() { + if (statusUpdateBuilder_ == null) { + if (payloadCase_ == 3) { + return (io.a2a.grpc.TaskStatusUpdateEvent) payload_; + } + return io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } else { + if (payloadCase_ == 3) { + return statusUpdateBuilder_.getMessage(); + } + return io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + public Builder setStatusUpdate(io.a2a.grpc.TaskStatusUpdateEvent value) { + if (statusUpdateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + statusUpdateBuilder_.setMessage(value); + } + payloadCase_ = 3; + return this; + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + public Builder setStatusUpdate( + io.a2a.grpc.TaskStatusUpdateEvent.Builder builderForValue) { + if (statusUpdateBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + statusUpdateBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 3; + return this; + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + public Builder mergeStatusUpdate(io.a2a.grpc.TaskStatusUpdateEvent value) { + if (statusUpdateBuilder_ == null) { + if (payloadCase_ == 3 && + payload_ != io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance()) { + payload_ = io.a2a.grpc.TaskStatusUpdateEvent.newBuilder((io.a2a.grpc.TaskStatusUpdateEvent) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 3) { + statusUpdateBuilder_.mergeFrom(value); + } else { + statusUpdateBuilder_.setMessage(value); + } + } + payloadCase_ = 3; + return this; + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + public Builder clearStatusUpdate() { + if (statusUpdateBuilder_ == null) { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 3) { + payloadCase_ = 0; + payload_ = null; + } + statusUpdateBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + public io.a2a.grpc.TaskStatusUpdateEvent.Builder getStatusUpdateBuilder() { + return internalGetStatusUpdateFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEventOrBuilder getStatusUpdateOrBuilder() { + if ((payloadCase_ == 3) && (statusUpdateBuilder_ != null)) { + return statusUpdateBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 3) { + return (io.a2a.grpc.TaskStatusUpdateEvent) payload_; + } + return io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } + } + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatusUpdateEvent, io.a2a.grpc.TaskStatusUpdateEvent.Builder, io.a2a.grpc.TaskStatusUpdateEventOrBuilder> + internalGetStatusUpdateFieldBuilder() { + if (statusUpdateBuilder_ == null) { + if (!(payloadCase_ == 3)) { + payload_ = io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } + statusUpdateBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatusUpdateEvent, io.a2a.grpc.TaskStatusUpdateEvent.Builder, io.a2a.grpc.TaskStatusUpdateEventOrBuilder>( + (io.a2a.grpc.TaskStatusUpdateEvent) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 3; + onChanged(); + return statusUpdateBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskArtifactUpdateEvent, io.a2a.grpc.TaskArtifactUpdateEvent.Builder, io.a2a.grpc.TaskArtifactUpdateEventOrBuilder> artifactUpdateBuilder_; + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + * @return Whether the artifactUpdate field is set. + */ + @java.lang.Override + public boolean hasArtifactUpdate() { + return payloadCase_ == 4; + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + * @return The artifactUpdate. + */ + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEvent getArtifactUpdate() { + if (artifactUpdateBuilder_ == null) { + if (payloadCase_ == 4) { + return (io.a2a.grpc.TaskArtifactUpdateEvent) payload_; + } + return io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } else { + if (payloadCase_ == 4) { + return artifactUpdateBuilder_.getMessage(); + } + return io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + public Builder setArtifactUpdate(io.a2a.grpc.TaskArtifactUpdateEvent value) { + if (artifactUpdateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + artifactUpdateBuilder_.setMessage(value); + } + payloadCase_ = 4; + return this; + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + public Builder setArtifactUpdate( + io.a2a.grpc.TaskArtifactUpdateEvent.Builder builderForValue) { + if (artifactUpdateBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + artifactUpdateBuilder_.setMessage(builderForValue.build()); + } + payloadCase_ = 4; + return this; + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + public Builder mergeArtifactUpdate(io.a2a.grpc.TaskArtifactUpdateEvent value) { + if (artifactUpdateBuilder_ == null) { + if (payloadCase_ == 4 && + payload_ != io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance()) { + payload_ = io.a2a.grpc.TaskArtifactUpdateEvent.newBuilder((io.a2a.grpc.TaskArtifactUpdateEvent) payload_) + .mergeFrom(value).buildPartial(); + } else { + payload_ = value; + } + onChanged(); + } else { + if (payloadCase_ == 4) { + artifactUpdateBuilder_.mergeFrom(value); + } else { + artifactUpdateBuilder_.setMessage(value); + } + } + payloadCase_ = 4; + return this; + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + public Builder clearArtifactUpdate() { + if (artifactUpdateBuilder_ == null) { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 4) { + payloadCase_ = 0; + payload_ = null; + } + artifactUpdateBuilder_.clear(); + } + return this; + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + public io.a2a.grpc.TaskArtifactUpdateEvent.Builder getArtifactUpdateBuilder() { + return internalGetArtifactUpdateFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEventOrBuilder getArtifactUpdateOrBuilder() { + if ((payloadCase_ == 4) && (artifactUpdateBuilder_ != null)) { + return artifactUpdateBuilder_.getMessageOrBuilder(); + } else { + if (payloadCase_ == 4) { + return (io.a2a.grpc.TaskArtifactUpdateEvent) payload_; + } + return io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } + } + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskArtifactUpdateEvent, io.a2a.grpc.TaskArtifactUpdateEvent.Builder, io.a2a.grpc.TaskArtifactUpdateEventOrBuilder> + internalGetArtifactUpdateFieldBuilder() { + if (artifactUpdateBuilder_ == null) { + if (!(payloadCase_ == 4)) { + payload_ = io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } + artifactUpdateBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskArtifactUpdateEvent, io.a2a.grpc.TaskArtifactUpdateEvent.Builder, io.a2a.grpc.TaskArtifactUpdateEventOrBuilder>( + (io.a2a.grpc.TaskArtifactUpdateEvent) payload_, + getParentForChildren(), + isClean()); + payload_ = null; + } + payloadCase_ = 4; + onChanged(); + return artifactUpdateBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.StreamResponse) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.StreamResponse) + private static final io.a2a.grpc.StreamResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.StreamResponse(); + } + + public static io.a2a.grpc.StreamResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamResponse 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 io.a2a.grpc.StreamResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/StreamResponseOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/StreamResponseOrBuilder.java new file mode 100644 index 000000000..3a17929cd --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/StreamResponseOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface StreamResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.StreamResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return Whether the task field is set. + */ + boolean hasTask(); + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + * @return The task. + */ + io.a2a.grpc.Task getTask(); + /** + * .a2a.v1.Task task = 1 [json_name = "task"]; + */ + io.a2a.grpc.TaskOrBuilder getTaskOrBuilder(); + + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return Whether the msg field is set. + */ + boolean hasMsg(); + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + * @return The msg. + */ + io.a2a.grpc.Message getMsg(); + /** + * .a2a.v1.Message msg = 2 [json_name = "message"]; + */ + io.a2a.grpc.MessageOrBuilder getMsgOrBuilder(); + + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + * @return Whether the statusUpdate field is set. + */ + boolean hasStatusUpdate(); + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + * @return The statusUpdate. + */ + io.a2a.grpc.TaskStatusUpdateEvent getStatusUpdate(); + /** + * .a2a.v1.TaskStatusUpdateEvent status_update = 3 [json_name = "statusUpdate"]; + */ + io.a2a.grpc.TaskStatusUpdateEventOrBuilder getStatusUpdateOrBuilder(); + + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + * @return Whether the artifactUpdate field is set. + */ + boolean hasArtifactUpdate(); + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + * @return The artifactUpdate. + */ + io.a2a.grpc.TaskArtifactUpdateEvent getArtifactUpdate(); + /** + * .a2a.v1.TaskArtifactUpdateEvent artifact_update = 4 [json_name = "artifactUpdate"]; + */ + io.a2a.grpc.TaskArtifactUpdateEventOrBuilder getArtifactUpdateOrBuilder(); + + io.a2a.grpc.StreamResponse.PayloadCase getPayloadCase(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/StringList.java b/grpc/src/main/java/io/a2a/grpc/StringList.java new file mode 100644 index 000000000..4ee06422d --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/StringList.java @@ -0,0 +1,563 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+ * 
+ * + * Protobuf type {@code a2a.v1.StringList} + */ +@com.google.protobuf.Generated +public final class StringList extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.StringList) + StringListOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + StringList.class.getName()); + } + // Use StringList.newBuilder() to construct. + private StringList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private StringList() { + list_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StringList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StringList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.StringList.class, io.a2a.grpc.StringList.Builder.class); + } + + public static final int LIST_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList list_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string list = 1 [json_name = "list"]; + * @return A list containing the list. + */ + public com.google.protobuf.ProtocolStringList + getListList() { + return list_; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @return The count of list. + */ + public int getListCount() { + return list_.size(); + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index of the element to return. + * @return The list at the given index. + */ + public java.lang.String getList(int index) { + return list_.get(index); + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index of the value to return. + * @return The bytes of the list at the given index. + */ + public com.google.protobuf.ByteString + getListBytes(int index) { + return list_.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 < list_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, list_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < list_.size(); i++) { + dataSize += computeStringSizeNoTag(list_.getRaw(i)); + } + size += dataSize; + size += 1 * getListList().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 io.a2a.grpc.StringList)) { + return super.equals(obj); + } + io.a2a.grpc.StringList other = (io.a2a.grpc.StringList) obj; + + if (!getListList() + .equals(other.getListList())) 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 (getListCount() > 0) { + hash = (37 * hash) + LIST_FIELD_NUMBER; + hash = (53 * hash) + getListList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.StringList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.StringList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.StringList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.StringList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.StringList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.StringList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.StringList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.StringList parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.StringList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.StringList parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.StringList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.StringList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.StringList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * 
+ * + * Protobuf type {@code a2a.v1.StringList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.StringList) + io.a2a.grpc.StringListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StringList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StringList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.StringList.class, io.a2a.grpc.StringList.Builder.class); + } + + // Construct using io.a2a.grpc.StringList.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + list_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_StringList_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.StringList getDefaultInstanceForType() { + return io.a2a.grpc.StringList.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.StringList build() { + io.a2a.grpc.StringList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.StringList buildPartial() { + io.a2a.grpc.StringList result = new io.a2a.grpc.StringList(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.StringList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + list_.makeImmutable(); + result.list_ = list_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.StringList) { + return mergeFrom((io.a2a.grpc.StringList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.StringList other) { + if (other == io.a2a.grpc.StringList.getDefaultInstance()) return this; + if (!other.list_.isEmpty()) { + if (list_.isEmpty()) { + list_ = other.list_; + bitField0_ |= 0x00000001; + } else { + ensureListIsMutable(); + list_.addAll(other.list_); + } + 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: { + java.lang.String s = input.readStringRequireUtf8(); + ensureListIsMutable(); + list_.add(s); + 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 com.google.protobuf.LazyStringArrayList list_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureListIsMutable() { + if (!list_.isModifiable()) { + list_ = new com.google.protobuf.LazyStringArrayList(list_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @return A list containing the list. + */ + public com.google.protobuf.ProtocolStringList + getListList() { + list_.makeImmutable(); + return list_; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @return The count of list. + */ + public int getListCount() { + return list_.size(); + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index of the element to return. + * @return The list at the given index. + */ + public java.lang.String getList(int index) { + return list_.get(index); + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index of the value to return. + * @return The bytes of the list at the given index. + */ + public com.google.protobuf.ByteString + getListBytes(int index) { + return list_.getByteString(index); + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index to set the value at. + * @param value The list to set. + * @return This builder for chaining. + */ + public Builder setList( + int index, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureListIsMutable(); + list_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param value The list to add. + * @return This builder for chaining. + */ + public Builder addList( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureListIsMutable(); + list_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param values The list to add. + * @return This builder for chaining. + */ + public Builder addAllList( + java.lang.Iterable values) { + ensureListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, list_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @return This builder for chaining. + */ + public Builder clearList() { + list_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string list = 1 [json_name = "list"]; + * @param value The bytes of the list to add. + * @return This builder for chaining. + */ + public Builder addListBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureListIsMutable(); + list_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.StringList) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.StringList) + private static final io.a2a.grpc.StringList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.StringList(); + } + + public static io.a2a.grpc.StringList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringList 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 io.a2a.grpc.StringList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/StringListOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/StringListOrBuilder.java new file mode 100644 index 000000000..fbc8bf9db --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/StringListOrBuilder.java @@ -0,0 +1,37 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface StringListOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.StringList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string list = 1 [json_name = "list"]; + * @return A list containing the list. + */ + java.util.List + getListList(); + /** + * repeated string list = 1 [json_name = "list"]; + * @return The count of list. + */ + int getListCount(); + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index of the element to return. + * @return The list at the given index. + */ + java.lang.String getList(int index); + /** + * repeated string list = 1 [json_name = "list"]; + * @param index The index of the value to return. + * @return The bytes of the list at the given index. + */ + com.google.protobuf.ByteString + getListBytes(int index); +} diff --git a/grpc/src/main/java/io/a2a/grpc/Task.java b/grpc/src/main/java/io/a2a/grpc/Task.java new file mode 100644 index 000000000..74605278b --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/Task.java @@ -0,0 +1,2114 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * Task is the core unit of action for A2A. It has a current status
+ * and when results are created for the task they are stored in the
+ * artifact. If there are multiple turns for a task, these are stored in
+ * history.
+ * 
+ * + * Protobuf type {@code a2a.v1.Task} + */ +@com.google.protobuf.Generated +public final class Task extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.Task) + TaskOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + Task.class.getName()); + } + // Use Task.newBuilder() to construct. + private Task(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Task() { + id_ = ""; + contextId_ = ""; + artifacts_ = java.util.Collections.emptyList(); + history_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Task_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Task_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Task.class, io.a2a.grpc.Task.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + *
+   * Unique identifier for a task, created by the A2A server.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + *
+   * Unique identifier for a task, created by the A2A server.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object contextId_ = ""; + /** + *
+   * Unique identifier for the contextual collection of interactions (tasks
+   * and messages). Created by the A2A server.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + @java.lang.Override + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + 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(); + contextId_ = s; + return s; + } + } + /** + *
+   * Unique identifier for the contextual collection of interactions (tasks
+   * and messages). Created by the A2A server.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 3; + private io.a2a.grpc.TaskStatus status_; + /** + *
+   * The current status of a Task, including state and a message.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The current status of a Task, including state and a message.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return The status. + */ + @java.lang.Override + public io.a2a.grpc.TaskStatus getStatus() { + return status_ == null ? io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } + /** + *
+   * The current status of a Task, including state and a message.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskStatusOrBuilder getStatusOrBuilder() { + return status_ == null ? io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } + + public static final int ARTIFACTS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private java.util.List artifacts_; + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + @java.lang.Override + public java.util.List getArtifactsList() { + return artifacts_; + } + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + @java.lang.Override + public java.util.List + getArtifactsOrBuilderList() { + return artifacts_; + } + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + @java.lang.Override + public int getArtifactsCount() { + return artifacts_.size(); + } + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + @java.lang.Override + public io.a2a.grpc.Artifact getArtifacts(int index) { + return artifacts_.get(index); + } + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + @java.lang.Override + public io.a2a.grpc.ArtifactOrBuilder getArtifactsOrBuilder( + int index) { + return artifacts_.get(index); + } + + public static final int HISTORY_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private java.util.List history_; + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + @java.lang.Override + public java.util.List getHistoryList() { + return history_; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + @java.lang.Override + public java.util.List + getHistoryOrBuilderList() { + return history_; + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + @java.lang.Override + public int getHistoryCount() { + return history_.size(); + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + @java.lang.Override + public io.a2a.grpc.Message getHistory(int index) { + return history_.get(index); + } + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getHistoryOrBuilder( + int index) { + return history_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct metadata_; + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * A key/value object to store custom metadata about a task.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * A key/value object to store custom metadata about a task.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * A key/value object to store custom metadata about a task.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + 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.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, contextId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getStatus()); + } + for (int i = 0; i < artifacts_.size(); i++) { + output.writeMessage(4, artifacts_.get(i)); + } + for (int i = 0; i < history_.size(); i++) { + output.writeMessage(5, history_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, contextId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getStatus()); + } + for (int i = 0; i < artifacts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, artifacts_.get(i)); + } + for (int i = 0; i < history_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, history_.get(i)); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getMetadata()); + } + 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 io.a2a.grpc.Task)) { + return super.equals(obj); + } + io.a2a.grpc.Task other = (io.a2a.grpc.Task) obj; + + if (!getId() + .equals(other.getId())) return false; + if (!getContextId() + .equals(other.getContextId())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus() + .equals(other.getStatus())) return false; + } + if (!getArtifactsList() + .equals(other.getArtifactsList())) return false; + if (!getHistoryList() + .equals(other.getHistoryList())) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (getArtifactsCount() > 0) { + hash = (37 * hash) + ARTIFACTS_FIELD_NUMBER; + hash = (53 * hash) + getArtifactsList().hashCode(); + } + if (getHistoryCount() > 0) { + hash = (37 * hash) + HISTORY_FIELD_NUMBER; + hash = (53 * hash) + getHistoryList().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.Task parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Task parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Task parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Task parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Task parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.Task parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.Task parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Task parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.Task parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.Task parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.Task parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.Task parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.Task 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Task is the core unit of action for A2A. It has a current status
+   * and when results are created for the task they are stored in the
+   * artifact. If there are multiple turns for a task, these are stored in
+   * history.
+   * 
+ * + * Protobuf type {@code a2a.v1.Task} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.Task) + io.a2a.grpc.TaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Task_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Task_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.Task.class, io.a2a.grpc.Task.Builder.class); + } + + // Construct using io.a2a.grpc.Task.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + internalGetArtifactsFieldBuilder(); + internalGetHistoryFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + contextId_ = ""; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + if (artifactsBuilder_ == null) { + artifacts_ = java.util.Collections.emptyList(); + } else { + artifacts_ = null; + artifactsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + if (historyBuilder_ == null) { + history_ = java.util.Collections.emptyList(); + } else { + history_ = null; + historyBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_Task_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.Task getDefaultInstanceForType() { + return io.a2a.grpc.Task.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.Task build() { + io.a2a.grpc.Task result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.Task buildPartial() { + io.a2a.grpc.Task result = new io.a2a.grpc.Task(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.a2a.grpc.Task result) { + if (artifactsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + artifacts_ = java.util.Collections.unmodifiableList(artifacts_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.artifacts_ = artifacts_; + } else { + result.artifacts_ = artifactsBuilder_.build(); + } + if (historyBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + history_ = java.util.Collections.unmodifiableList(history_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.history_ = history_; + } else { + result.history_ = historyBuilder_.build(); + } + } + + private void buildPartial0(io.a2a.grpc.Task result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contextId_ = contextId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = statusBuilder_ == null + ? status_ + : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.metadata_ = metadataBuilder_ == null + ? metadata_ + : metadataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.Task) { + return mergeFrom((io.a2a.grpc.Task)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.Task other) { + if (other == io.a2a.grpc.Task.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContextId().isEmpty()) { + contextId_ = other.contextId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (artifactsBuilder_ == null) { + if (!other.artifacts_.isEmpty()) { + if (artifacts_.isEmpty()) { + artifacts_ = other.artifacts_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureArtifactsIsMutable(); + artifacts_.addAll(other.artifacts_); + } + onChanged(); + } + } else { + if (!other.artifacts_.isEmpty()) { + if (artifactsBuilder_.isEmpty()) { + artifactsBuilder_.dispose(); + artifactsBuilder_ = null; + artifacts_ = other.artifacts_; + bitField0_ = (bitField0_ & ~0x00000008); + artifactsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetArtifactsFieldBuilder() : null; + } else { + artifactsBuilder_.addAllMessages(other.artifacts_); + } + } + } + if (historyBuilder_ == null) { + if (!other.history_.isEmpty()) { + if (history_.isEmpty()) { + history_ = other.history_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureHistoryIsMutable(); + history_.addAll(other.history_); + } + onChanged(); + } + } else { + if (!other.history_.isEmpty()) { + if (historyBuilder_.isEmpty()) { + historyBuilder_.dispose(); + historyBuilder_ = null; + history_ = other.history_; + bitField0_ = (bitField0_ & ~0x00000010); + historyBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + internalGetHistoryFieldBuilder() : null; + } else { + historyBuilder_.addAllMessages(other.history_); + } + } + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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: { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + contextId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetStatusFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: { + io.a2a.grpc.Artifact m = + input.readMessage( + io.a2a.grpc.Artifact.parser(), + extensionRegistry); + if (artifactsBuilder_ == null) { + ensureArtifactsIsMutable(); + artifacts_.add(m); + } else { + artifactsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: { + io.a2a.grpc.Message m = + input.readMessage( + io.a2a.grpc.Message.parser(), + extensionRegistry); + if (historyBuilder_ == null) { + ensureHistoryIsMutable(); + history_.add(m); + } else { + historyBuilder_.addMessage(m); + } + break; + } // case 42 + case 50: { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + 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 id_ = ""; + /** + *
+     * Unique identifier for a task, created by the A2A server.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Unique identifier for a task, created by the A2A server.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Unique identifier for a task, created by the A2A server.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Unique identifier for a task, created by the A2A server.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Unique identifier for a task, created by the A2A server.
+     * 
+ * + * string id = 1 [json_name = "id"]; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contextId_ = ""; + /** + *
+     * Unique identifier for the contextual collection of interactions (tasks
+     * and messages). Created by the A2A server.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contextId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Unique identifier for the contextual collection of interactions (tasks
+     * and messages). Created by the A2A server.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Unique identifier for the contextual collection of interactions (tasks
+     * and messages). Created by the A2A server.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The contextId to set. + * @return This builder for chaining. + */ + public Builder setContextId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * Unique identifier for the contextual collection of interactions (tasks
+     * and messages). Created by the A2A server.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return This builder for chaining. + */ + public Builder clearContextId() { + contextId_ = getDefaultInstance().getContextId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Unique identifier for the contextual collection of interactions (tasks
+     * and messages). Created by the A2A server.
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The bytes for contextId to set. + * @return This builder for chaining. + */ + public Builder setContextIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private io.a2a.grpc.TaskStatus status_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatus, io.a2a.grpc.TaskStatus.Builder, io.a2a.grpc.TaskStatusOrBuilder> statusBuilder_; + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return The status. + */ + public io.a2a.grpc.TaskStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder setStatus(io.a2a.grpc.TaskStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder setStatus( + io.a2a.grpc.TaskStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder mergeStatus(io.a2a.grpc.TaskStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + status_ != null && + status_ != io.a2a.grpc.TaskStatus.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public io.a2a.grpc.TaskStatus.Builder getStatusBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public io.a2a.grpc.TaskStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? + io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } + } + /** + *
+     * The current status of a Task, including state and a message.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatus, io.a2a.grpc.TaskStatus.Builder, io.a2a.grpc.TaskStatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatus, io.a2a.grpc.TaskStatus.Builder, io.a2a.grpc.TaskStatusOrBuilder>( + getStatus(), + getParentForChildren(), + isClean()); + status_ = null; + } + return statusBuilder_; + } + + private java.util.List artifacts_ = + java.util.Collections.emptyList(); + private void ensureArtifactsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + artifacts_ = new java.util.ArrayList(artifacts_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Artifact, io.a2a.grpc.Artifact.Builder, io.a2a.grpc.ArtifactOrBuilder> artifactsBuilder_; + + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public java.util.List getArtifactsList() { + if (artifactsBuilder_ == null) { + return java.util.Collections.unmodifiableList(artifacts_); + } else { + return artifactsBuilder_.getMessageList(); + } + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public int getArtifactsCount() { + if (artifactsBuilder_ == null) { + return artifacts_.size(); + } else { + return artifactsBuilder_.getCount(); + } + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public io.a2a.grpc.Artifact getArtifacts(int index) { + if (artifactsBuilder_ == null) { + return artifacts_.get(index); + } else { + return artifactsBuilder_.getMessage(index); + } + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder setArtifacts( + int index, io.a2a.grpc.Artifact value) { + if (artifactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArtifactsIsMutable(); + artifacts_.set(index, value); + onChanged(); + } else { + artifactsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder setArtifacts( + int index, io.a2a.grpc.Artifact.Builder builderForValue) { + if (artifactsBuilder_ == null) { + ensureArtifactsIsMutable(); + artifacts_.set(index, builderForValue.build()); + onChanged(); + } else { + artifactsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder addArtifacts(io.a2a.grpc.Artifact value) { + if (artifactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArtifactsIsMutable(); + artifacts_.add(value); + onChanged(); + } else { + artifactsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder addArtifacts( + int index, io.a2a.grpc.Artifact value) { + if (artifactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArtifactsIsMutable(); + artifacts_.add(index, value); + onChanged(); + } else { + artifactsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder addArtifacts( + io.a2a.grpc.Artifact.Builder builderForValue) { + if (artifactsBuilder_ == null) { + ensureArtifactsIsMutable(); + artifacts_.add(builderForValue.build()); + onChanged(); + } else { + artifactsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder addArtifacts( + int index, io.a2a.grpc.Artifact.Builder builderForValue) { + if (artifactsBuilder_ == null) { + ensureArtifactsIsMutable(); + artifacts_.add(index, builderForValue.build()); + onChanged(); + } else { + artifactsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder addAllArtifacts( + java.lang.Iterable values) { + if (artifactsBuilder_ == null) { + ensureArtifactsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, artifacts_); + onChanged(); + } else { + artifactsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder clearArtifacts() { + if (artifactsBuilder_ == null) { + artifacts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + artifactsBuilder_.clear(); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public Builder removeArtifacts(int index) { + if (artifactsBuilder_ == null) { + ensureArtifactsIsMutable(); + artifacts_.remove(index); + onChanged(); + } else { + artifactsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public io.a2a.grpc.Artifact.Builder getArtifactsBuilder( + int index) { + return internalGetArtifactsFieldBuilder().getBuilder(index); + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public io.a2a.grpc.ArtifactOrBuilder getArtifactsOrBuilder( + int index) { + if (artifactsBuilder_ == null) { + return artifacts_.get(index); } else { + return artifactsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public java.util.List + getArtifactsOrBuilderList() { + if (artifactsBuilder_ != null) { + return artifactsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(artifacts_); + } + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public io.a2a.grpc.Artifact.Builder addArtifactsBuilder() { + return internalGetArtifactsFieldBuilder().addBuilder( + io.a2a.grpc.Artifact.getDefaultInstance()); + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public io.a2a.grpc.Artifact.Builder addArtifactsBuilder( + int index) { + return internalGetArtifactsFieldBuilder().addBuilder( + index, io.a2a.grpc.Artifact.getDefaultInstance()); + } + /** + *
+     * A set of output artifacts for a Task.
+     * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + public java.util.List + getArtifactsBuilderList() { + return internalGetArtifactsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Artifact, io.a2a.grpc.Artifact.Builder, io.a2a.grpc.ArtifactOrBuilder> + internalGetArtifactsFieldBuilder() { + if (artifactsBuilder_ == null) { + artifactsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Artifact, io.a2a.grpc.Artifact.Builder, io.a2a.grpc.ArtifactOrBuilder>( + artifacts_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + artifacts_ = null; + } + return artifactsBuilder_; + } + + private java.util.List history_ = + java.util.Collections.emptyList(); + private void ensureHistoryIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + history_ = new java.util.ArrayList(history_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> historyBuilder_; + + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public java.util.List getHistoryList() { + if (historyBuilder_ == null) { + return java.util.Collections.unmodifiableList(history_); + } else { + return historyBuilder_.getMessageList(); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public int getHistoryCount() { + if (historyBuilder_ == null) { + return history_.size(); + } else { + return historyBuilder_.getCount(); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public io.a2a.grpc.Message getHistory(int index) { + if (historyBuilder_ == null) { + return history_.get(index); + } else { + return historyBuilder_.getMessage(index); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder setHistory( + int index, io.a2a.grpc.Message value) { + if (historyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistoryIsMutable(); + history_.set(index, value); + onChanged(); + } else { + historyBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder setHistory( + int index, io.a2a.grpc.Message.Builder builderForValue) { + if (historyBuilder_ == null) { + ensureHistoryIsMutable(); + history_.set(index, builderForValue.build()); + onChanged(); + } else { + historyBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder addHistory(io.a2a.grpc.Message value) { + if (historyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistoryIsMutable(); + history_.add(value); + onChanged(); + } else { + historyBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder addHistory( + int index, io.a2a.grpc.Message value) { + if (historyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHistoryIsMutable(); + history_.add(index, value); + onChanged(); + } else { + historyBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder addHistory( + io.a2a.grpc.Message.Builder builderForValue) { + if (historyBuilder_ == null) { + ensureHistoryIsMutable(); + history_.add(builderForValue.build()); + onChanged(); + } else { + historyBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder addHistory( + int index, io.a2a.grpc.Message.Builder builderForValue) { + if (historyBuilder_ == null) { + ensureHistoryIsMutable(); + history_.add(index, builderForValue.build()); + onChanged(); + } else { + historyBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder addAllHistory( + java.lang.Iterable values) { + if (historyBuilder_ == null) { + ensureHistoryIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, history_); + onChanged(); + } else { + historyBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder clearHistory() { + if (historyBuilder_ == null) { + history_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + historyBuilder_.clear(); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public Builder removeHistory(int index) { + if (historyBuilder_ == null) { + ensureHistoryIsMutable(); + history_.remove(index); + onChanged(); + } else { + historyBuilder_.remove(index); + } + return this; + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public io.a2a.grpc.Message.Builder getHistoryBuilder( + int index) { + return internalGetHistoryFieldBuilder().getBuilder(index); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public io.a2a.grpc.MessageOrBuilder getHistoryOrBuilder( + int index) { + if (historyBuilder_ == null) { + return history_.get(index); } else { + return historyBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public java.util.List + getHistoryOrBuilderList() { + if (historyBuilder_ != null) { + return historyBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(history_); + } + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public io.a2a.grpc.Message.Builder addHistoryBuilder() { + return internalGetHistoryFieldBuilder().addBuilder( + io.a2a.grpc.Message.getDefaultInstance()); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public io.a2a.grpc.Message.Builder addHistoryBuilder( + int index) { + return internalGetHistoryFieldBuilder().addBuilder( + index, io.a2a.grpc.Message.getDefaultInstance()); + } + /** + *
+     * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+     * The history of interactions from a task.
+     * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + public java.util.List + getHistoryBuilderList() { + return internalGetHistoryFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> + internalGetHistoryFieldBuilder() { + if (historyBuilder_ == null) { + historyBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder>( + history_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + history_ = null; + } + return historyBuilder_; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata( + com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + metadata_ != null && + metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000020); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + *
+     * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+     * A key/value object to store custom metadata about a task.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.Task) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.Task) + private static final io.a2a.grpc.Task DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.Task(); + } + + public static io.a2a.grpc.Task getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Task 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 io.a2a.grpc.Task getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskArtifactUpdateEvent.java b/grpc/src/main/java/io/a2a/grpc/TaskArtifactUpdateEvent.java new file mode 100644 index 000000000..2019adc0c --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskArtifactUpdateEvent.java @@ -0,0 +1,1344 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * TaskArtifactUpdateEvent represents a task delta where an artifact has
+ * been generated.
+ * 
+ * + * Protobuf type {@code a2a.v1.TaskArtifactUpdateEvent} + */ +@com.google.protobuf.Generated +public final class TaskArtifactUpdateEvent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.TaskArtifactUpdateEvent) + TaskArtifactUpdateEventOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + TaskArtifactUpdateEvent.class.getName()); + } + // Use TaskArtifactUpdateEvent.newBuilder() to construct. + private TaskArtifactUpdateEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaskArtifactUpdateEvent() { + taskId_ = ""; + contextId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskArtifactUpdateEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskArtifactUpdateEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskArtifactUpdateEvent.class, io.a2a.grpc.TaskArtifactUpdateEvent.Builder.class); + } + + private int bitField0_; + public static final int TASK_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object taskId_ = ""; + /** + *
+   * The id of the task for this artifact
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The taskId. + */ + @java.lang.Override + public java.lang.String getTaskId() { + java.lang.Object ref = taskId_; + 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(); + taskId_ = s; + return s; + } + } + /** + *
+   * The id of the task for this artifact
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTaskIdBytes() { + java.lang.Object ref = taskId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object contextId_ = ""; + /** + *
+   * The id of the context that this task belongs too
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + @java.lang.Override + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + 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(); + contextId_ = s; + return s; + } + } + /** + *
+   * The id of the context that this task belongs too
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ARTIFACT_FIELD_NUMBER = 3; + private io.a2a.grpc.Artifact artifact_; + /** + *
+   * The artifact itself
+   * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + * @return Whether the artifact field is set. + */ + @java.lang.Override + public boolean hasArtifact() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The artifact itself
+   * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + * @return The artifact. + */ + @java.lang.Override + public io.a2a.grpc.Artifact getArtifact() { + return artifact_ == null ? io.a2a.grpc.Artifact.getDefaultInstance() : artifact_; + } + /** + *
+   * The artifact itself
+   * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + @java.lang.Override + public io.a2a.grpc.ArtifactOrBuilder getArtifactOrBuilder() { + return artifact_ == null ? io.a2a.grpc.Artifact.getDefaultInstance() : artifact_; + } + + public static final int APPEND_FIELD_NUMBER = 4; + private boolean append_ = false; + /** + *
+   * Whether this should be appended to a prior one produced
+   * 
+ * + * bool append = 4 [json_name = "append"]; + * @return The append. + */ + @java.lang.Override + public boolean getAppend() { + return append_; + } + + public static final int LAST_CHUNK_FIELD_NUMBER = 5; + private boolean lastChunk_ = false; + /** + *
+   * Whether this represents the last part of an artifact
+   * 
+ * + * bool last_chunk = 5 [json_name = "lastChunk"]; + * @return The lastChunk. + */ + @java.lang.Override + public boolean getLastChunk() { + return lastChunk_; + } + + public static final int METADATA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct metadata_; + /** + *
+   * Optional metadata associated with the artifact update.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * Optional metadata associated with the artifact update.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + *
+   * Optional metadata associated with the artifact update.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + 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.GeneratedMessage.isStringEmpty(taskId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, taskId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, contextId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getArtifact()); + } + if (append_ != false) { + output.writeBool(4, append_); + } + if (lastChunk_ != false) { + output.writeBool(5, lastChunk_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(taskId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, taskId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, contextId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getArtifact()); + } + if (append_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, append_); + } + if (lastChunk_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, lastChunk_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getMetadata()); + } + 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 io.a2a.grpc.TaskArtifactUpdateEvent)) { + return super.equals(obj); + } + io.a2a.grpc.TaskArtifactUpdateEvent other = (io.a2a.grpc.TaskArtifactUpdateEvent) obj; + + if (!getTaskId() + .equals(other.getTaskId())) return false; + if (!getContextId() + .equals(other.getContextId())) return false; + if (hasArtifact() != other.hasArtifact()) return false; + if (hasArtifact()) { + if (!getArtifact() + .equals(other.getArtifact())) return false; + } + if (getAppend() + != other.getAppend()) return false; + if (getLastChunk() + != other.getLastChunk()) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) 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) + TASK_ID_FIELD_NUMBER; + hash = (53 * hash) + getTaskId().hashCode(); + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + if (hasArtifact()) { + hash = (37 * hash) + ARTIFACT_FIELD_NUMBER; + hash = (53 * hash) + getArtifact().hashCode(); + } + hash = (37 * hash) + APPEND_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAppend()); + hash = (37 * hash) + LAST_CHUNK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getLastChunk()); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.TaskArtifactUpdateEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.TaskArtifactUpdateEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskArtifactUpdateEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.TaskArtifactUpdateEvent 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * TaskArtifactUpdateEvent represents a task delta where an artifact has
+   * been generated.
+   * 
+ * + * Protobuf type {@code a2a.v1.TaskArtifactUpdateEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.TaskArtifactUpdateEvent) + io.a2a.grpc.TaskArtifactUpdateEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskArtifactUpdateEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskArtifactUpdateEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskArtifactUpdateEvent.class, io.a2a.grpc.TaskArtifactUpdateEvent.Builder.class); + } + + // Construct using io.a2a.grpc.TaskArtifactUpdateEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetArtifactFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + taskId_ = ""; + contextId_ = ""; + artifact_ = null; + if (artifactBuilder_ != null) { + artifactBuilder_.dispose(); + artifactBuilder_ = null; + } + append_ = false; + lastChunk_ = false; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskArtifactUpdateEvent_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEvent getDefaultInstanceForType() { + return io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEvent build() { + io.a2a.grpc.TaskArtifactUpdateEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.TaskArtifactUpdateEvent buildPartial() { + io.a2a.grpc.TaskArtifactUpdateEvent result = new io.a2a.grpc.TaskArtifactUpdateEvent(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.TaskArtifactUpdateEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.taskId_ = taskId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contextId_ = contextId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.artifact_ = artifactBuilder_ == null + ? artifact_ + : artifactBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.append_ = append_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.lastChunk_ = lastChunk_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.metadata_ = metadataBuilder_ == null + ? metadata_ + : metadataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.TaskArtifactUpdateEvent) { + return mergeFrom((io.a2a.grpc.TaskArtifactUpdateEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.TaskArtifactUpdateEvent other) { + if (other == io.a2a.grpc.TaskArtifactUpdateEvent.getDefaultInstance()) return this; + if (!other.getTaskId().isEmpty()) { + taskId_ = other.taskId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContextId().isEmpty()) { + contextId_ = other.contextId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasArtifact()) { + mergeArtifact(other.getArtifact()); + } + if (other.getAppend() != false) { + setAppend(other.getAppend()); + } + if (other.getLastChunk() != false) { + setLastChunk(other.getLastChunk()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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: { + taskId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + contextId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetArtifactFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + append_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + lastChunk_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + 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 taskId_ = ""; + /** + *
+     * The id of the task for this artifact
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The taskId. + */ + public java.lang.String getTaskId() { + java.lang.Object ref = taskId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The id of the task for this artifact
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + public com.google.protobuf.ByteString + getTaskIdBytes() { + java.lang.Object ref = taskId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The id of the task for this artifact
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @param value The taskId to set. + * @return This builder for chaining. + */ + public Builder setTaskId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + taskId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The id of the task for this artifact
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return This builder for chaining. + */ + public Builder clearTaskId() { + taskId_ = getDefaultInstance().getTaskId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The id of the task for this artifact
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @param value The bytes for taskId to set. + * @return This builder for chaining. + */ + public Builder setTaskIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + taskId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contextId_ = ""; + /** + *
+     * The id of the context that this task belongs too
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contextId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The id of the context that this task belongs too
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The id of the context that this task belongs too
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The contextId to set. + * @return This builder for chaining. + */ + public Builder setContextId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The id of the context that this task belongs too
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return This builder for chaining. + */ + public Builder clearContextId() { + contextId_ = getDefaultInstance().getContextId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The id of the context that this task belongs too
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The bytes for contextId to set. + * @return This builder for chaining. + */ + public Builder setContextIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private io.a2a.grpc.Artifact artifact_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Artifact, io.a2a.grpc.Artifact.Builder, io.a2a.grpc.ArtifactOrBuilder> artifactBuilder_; + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + * @return Whether the artifact field is set. + */ + public boolean hasArtifact() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + * @return The artifact. + */ + public io.a2a.grpc.Artifact getArtifact() { + if (artifactBuilder_ == null) { + return artifact_ == null ? io.a2a.grpc.Artifact.getDefaultInstance() : artifact_; + } else { + return artifactBuilder_.getMessage(); + } + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + public Builder setArtifact(io.a2a.grpc.Artifact value) { + if (artifactBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + artifact_ = value; + } else { + artifactBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + public Builder setArtifact( + io.a2a.grpc.Artifact.Builder builderForValue) { + if (artifactBuilder_ == null) { + artifact_ = builderForValue.build(); + } else { + artifactBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + public Builder mergeArtifact(io.a2a.grpc.Artifact value) { + if (artifactBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + artifact_ != null && + artifact_ != io.a2a.grpc.Artifact.getDefaultInstance()) { + getArtifactBuilder().mergeFrom(value); + } else { + artifact_ = value; + } + } else { + artifactBuilder_.mergeFrom(value); + } + if (artifact_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + public Builder clearArtifact() { + bitField0_ = (bitField0_ & ~0x00000004); + artifact_ = null; + if (artifactBuilder_ != null) { + artifactBuilder_.dispose(); + artifactBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + public io.a2a.grpc.Artifact.Builder getArtifactBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetArtifactFieldBuilder().getBuilder(); + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + public io.a2a.grpc.ArtifactOrBuilder getArtifactOrBuilder() { + if (artifactBuilder_ != null) { + return artifactBuilder_.getMessageOrBuilder(); + } else { + return artifact_ == null ? + io.a2a.grpc.Artifact.getDefaultInstance() : artifact_; + } + } + /** + *
+     * The artifact itself
+     * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Artifact, io.a2a.grpc.Artifact.Builder, io.a2a.grpc.ArtifactOrBuilder> + internalGetArtifactFieldBuilder() { + if (artifactBuilder_ == null) { + artifactBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Artifact, io.a2a.grpc.Artifact.Builder, io.a2a.grpc.ArtifactOrBuilder>( + getArtifact(), + getParentForChildren(), + isClean()); + artifact_ = null; + } + return artifactBuilder_; + } + + private boolean append_ ; + /** + *
+     * Whether this should be appended to a prior one produced
+     * 
+ * + * bool append = 4 [json_name = "append"]; + * @return The append. + */ + @java.lang.Override + public boolean getAppend() { + return append_; + } + /** + *
+     * Whether this should be appended to a prior one produced
+     * 
+ * + * bool append = 4 [json_name = "append"]; + * @param value The append to set. + * @return This builder for chaining. + */ + public Builder setAppend(boolean value) { + + append_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Whether this should be appended to a prior one produced
+     * 
+ * + * bool append = 4 [json_name = "append"]; + * @return This builder for chaining. + */ + public Builder clearAppend() { + bitField0_ = (bitField0_ & ~0x00000008); + append_ = false; + onChanged(); + return this; + } + + private boolean lastChunk_ ; + /** + *
+     * Whether this represents the last part of an artifact
+     * 
+ * + * bool last_chunk = 5 [json_name = "lastChunk"]; + * @return The lastChunk. + */ + @java.lang.Override + public boolean getLastChunk() { + return lastChunk_; + } + /** + *
+     * Whether this represents the last part of an artifact
+     * 
+ * + * bool last_chunk = 5 [json_name = "lastChunk"]; + * @param value The lastChunk to set. + * @return This builder for chaining. + */ + public Builder setLastChunk(boolean value) { + + lastChunk_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * Whether this represents the last part of an artifact
+     * 
+ * + * bool last_chunk = 5 [json_name = "lastChunk"]; + * @return This builder for chaining. + */ + public Builder clearLastChunk() { + bitField0_ = (bitField0_ & ~0x00000010); + lastChunk_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder setMetadata( + com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + metadata_ != null && + metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000020); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + *
+     * Optional metadata associated with the artifact update.
+     * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.TaskArtifactUpdateEvent) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.TaskArtifactUpdateEvent) + private static final io.a2a.grpc.TaskArtifactUpdateEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.TaskArtifactUpdateEvent(); + } + + public static io.a2a.grpc.TaskArtifactUpdateEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskArtifactUpdateEvent 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 io.a2a.grpc.TaskArtifactUpdateEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskArtifactUpdateEventOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/TaskArtifactUpdateEventOrBuilder.java new file mode 100644 index 000000000..5e0c4c98f --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskArtifactUpdateEventOrBuilder.java @@ -0,0 +1,126 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface TaskArtifactUpdateEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.TaskArtifactUpdateEvent) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The id of the task for this artifact
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The taskId. + */ + java.lang.String getTaskId(); + /** + *
+   * The id of the task for this artifact
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + com.google.protobuf.ByteString + getTaskIdBytes(); + + /** + *
+   * The id of the context that this task belongs too
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + java.lang.String getContextId(); + /** + *
+   * The id of the context that this task belongs too
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + com.google.protobuf.ByteString + getContextIdBytes(); + + /** + *
+   * The artifact itself
+   * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + * @return Whether the artifact field is set. + */ + boolean hasArtifact(); + /** + *
+   * The artifact itself
+   * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + * @return The artifact. + */ + io.a2a.grpc.Artifact getArtifact(); + /** + *
+   * The artifact itself
+   * 
+ * + * .a2a.v1.Artifact artifact = 3 [json_name = "artifact"]; + */ + io.a2a.grpc.ArtifactOrBuilder getArtifactOrBuilder(); + + /** + *
+   * Whether this should be appended to a prior one produced
+   * 
+ * + * bool append = 4 [json_name = "append"]; + * @return The append. + */ + boolean getAppend(); + + /** + *
+   * Whether this represents the last part of an artifact
+   * 
+ * + * bool last_chunk = 5 [json_name = "lastChunk"]; + * @return The lastChunk. + */ + boolean getLastChunk(); + + /** + *
+   * Optional metadata associated with the artifact update.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * Optional metadata associated with the artifact update.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + *
+   * Optional metadata associated with the artifact update.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/TaskOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/TaskOrBuilder.java new file mode 100644 index 000000000..d4bcf9727 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskOrBuilder.java @@ -0,0 +1,204 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface TaskOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.Task) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Unique identifier for a task, created by the A2A server.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The id. + */ + java.lang.String getId(); + /** + *
+   * Unique identifier for a task, created by the A2A server.
+   * 
+ * + * string id = 1 [json_name = "id"]; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * Unique identifier for the contextual collection of interactions (tasks
+   * and messages). Created by the A2A server.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + java.lang.String getContextId(); + /** + *
+   * Unique identifier for the contextual collection of interactions (tasks
+   * and messages). Created by the A2A server.
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + com.google.protobuf.ByteString + getContextIdBytes(); + + /** + *
+   * The current status of a Task, including state and a message.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + *
+   * The current status of a Task, including state and a message.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return The status. + */ + io.a2a.grpc.TaskStatus getStatus(); + /** + *
+   * The current status of a Task, including state and a message.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + io.a2a.grpc.TaskStatusOrBuilder getStatusOrBuilder(); + + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + java.util.List + getArtifactsList(); + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + io.a2a.grpc.Artifact getArtifacts(int index); + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + int getArtifactsCount(); + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + java.util.List + getArtifactsOrBuilderList(); + /** + *
+   * A set of output artifacts for a Task.
+   * 
+ * + * repeated .a2a.v1.Artifact artifacts = 4 [json_name = "artifacts"]; + */ + io.a2a.grpc.ArtifactOrBuilder getArtifactsOrBuilder( + int index); + + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + java.util.List + getHistoryList(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + io.a2a.grpc.Message getHistory(int index); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + int getHistoryCount(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + java.util.List + getHistoryOrBuilderList(); + /** + *
+   * protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
+   * The history of interactions from a task.
+   * 
+ * + * repeated .a2a.v1.Message history = 5 [json_name = "history"]; + */ + io.a2a.grpc.MessageOrBuilder getHistoryOrBuilder( + int index); + + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * A key/value object to store custom metadata about a task.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * A key/value object to store custom metadata about a task.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + *
+   * protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
+   * A key/value object to store custom metadata about a task.
+   * 
+ * + * .google.protobuf.Struct metadata = 6 [json_name = "metadata"]; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/TaskPushNotificationConfig.java b/grpc/src/main/java/io/a2a/grpc/TaskPushNotificationConfig.java new file mode 100644 index 000000000..89d2fdd85 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskPushNotificationConfig.java @@ -0,0 +1,723 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.TaskPushNotificationConfig} + */ +@com.google.protobuf.Generated +public final class TaskPushNotificationConfig extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.TaskPushNotificationConfig) + TaskPushNotificationConfigOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + TaskPushNotificationConfig.class.getName()); + } + // Use TaskPushNotificationConfig.newBuilder() to construct. + private TaskPushNotificationConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaskPushNotificationConfig() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskPushNotificationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskPushNotificationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskPushNotificationConfig.class, io.a2a.grpc.TaskPushNotificationConfig.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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 PUSH_NOTIFICATION_CONFIG_FIELD_NUMBER = 2; + private io.a2a.grpc.PushNotificationConfig pushNotificationConfig_; + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + * @return Whether the pushNotificationConfig field is set. + */ + @java.lang.Override + public boolean hasPushNotificationConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + * @return The pushNotificationConfig. + */ + @java.lang.Override + public io.a2a.grpc.PushNotificationConfig getPushNotificationConfig() { + return pushNotificationConfig_ == null ? io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotificationConfig_; + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + @java.lang.Override + public io.a2a.grpc.PushNotificationConfigOrBuilder getPushNotificationConfigOrBuilder() { + return pushNotificationConfig_ == null ? io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotificationConfig_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getPushNotificationConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPushNotificationConfig()); + } + 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 io.a2a.grpc.TaskPushNotificationConfig)) { + return super.equals(obj); + } + io.a2a.grpc.TaskPushNotificationConfig other = (io.a2a.grpc.TaskPushNotificationConfig) obj; + + if (!getName() + .equals(other.getName())) return false; + if (hasPushNotificationConfig() != other.hasPushNotificationConfig()) return false; + if (hasPushNotificationConfig()) { + if (!getPushNotificationConfig() + .equals(other.getPushNotificationConfig())) 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(); + if (hasPushNotificationConfig()) { + hash = (37 * hash) + PUSH_NOTIFICATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPushNotificationConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.TaskPushNotificationConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.TaskPushNotificationConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskPushNotificationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.TaskPushNotificationConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.TaskPushNotificationConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.TaskPushNotificationConfig) + io.a2a.grpc.TaskPushNotificationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskPushNotificationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskPushNotificationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskPushNotificationConfig.class, io.a2a.grpc.TaskPushNotificationConfig.Builder.class); + } + + // Construct using io.a2a.grpc.TaskPushNotificationConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetPushNotificationConfigFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + pushNotificationConfig_ = null; + if (pushNotificationConfigBuilder_ != null) { + pushNotificationConfigBuilder_.dispose(); + pushNotificationConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskPushNotificationConfig_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfig getDefaultInstanceForType() { + return io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfig build() { + io.a2a.grpc.TaskPushNotificationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.TaskPushNotificationConfig buildPartial() { + io.a2a.grpc.TaskPushNotificationConfig result = new io.a2a.grpc.TaskPushNotificationConfig(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.TaskPushNotificationConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pushNotificationConfig_ = pushNotificationConfigBuilder_ == null + ? pushNotificationConfig_ + : pushNotificationConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.TaskPushNotificationConfig) { + return mergeFrom((io.a2a.grpc.TaskPushNotificationConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.TaskPushNotificationConfig other) { + if (other == io.a2a.grpc.TaskPushNotificationConfig.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasPushNotificationConfig()) { + mergePushNotificationConfig(other.getPushNotificationConfig()); + } + 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: { + input.readMessage( + internalGetPushNotificationConfigFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + 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_ = ""; + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * name=tasks/{id}/pushNotificationConfigs/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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 io.a2a.grpc.PushNotificationConfig pushNotificationConfig_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PushNotificationConfig, io.a2a.grpc.PushNotificationConfig.Builder, io.a2a.grpc.PushNotificationConfigOrBuilder> pushNotificationConfigBuilder_; + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + * @return Whether the pushNotificationConfig field is set. + */ + public boolean hasPushNotificationConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + * @return The pushNotificationConfig. + */ + public io.a2a.grpc.PushNotificationConfig getPushNotificationConfig() { + if (pushNotificationConfigBuilder_ == null) { + return pushNotificationConfig_ == null ? io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotificationConfig_; + } else { + return pushNotificationConfigBuilder_.getMessage(); + } + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + public Builder setPushNotificationConfig(io.a2a.grpc.PushNotificationConfig value) { + if (pushNotificationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pushNotificationConfig_ = value; + } else { + pushNotificationConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + public Builder setPushNotificationConfig( + io.a2a.grpc.PushNotificationConfig.Builder builderForValue) { + if (pushNotificationConfigBuilder_ == null) { + pushNotificationConfig_ = builderForValue.build(); + } else { + pushNotificationConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + public Builder mergePushNotificationConfig(io.a2a.grpc.PushNotificationConfig value) { + if (pushNotificationConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + pushNotificationConfig_ != null && + pushNotificationConfig_ != io.a2a.grpc.PushNotificationConfig.getDefaultInstance()) { + getPushNotificationConfigBuilder().mergeFrom(value); + } else { + pushNotificationConfig_ = value; + } + } else { + pushNotificationConfigBuilder_.mergeFrom(value); + } + if (pushNotificationConfig_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + public Builder clearPushNotificationConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + pushNotificationConfig_ = null; + if (pushNotificationConfigBuilder_ != null) { + pushNotificationConfigBuilder_.dispose(); + pushNotificationConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + public io.a2a.grpc.PushNotificationConfig.Builder getPushNotificationConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetPushNotificationConfigFieldBuilder().getBuilder(); + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + public io.a2a.grpc.PushNotificationConfigOrBuilder getPushNotificationConfigOrBuilder() { + if (pushNotificationConfigBuilder_ != null) { + return pushNotificationConfigBuilder_.getMessageOrBuilder(); + } else { + return pushNotificationConfig_ == null ? + io.a2a.grpc.PushNotificationConfig.getDefaultInstance() : pushNotificationConfig_; + } + } + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PushNotificationConfig, io.a2a.grpc.PushNotificationConfig.Builder, io.a2a.grpc.PushNotificationConfigOrBuilder> + internalGetPushNotificationConfigFieldBuilder() { + if (pushNotificationConfigBuilder_ == null) { + pushNotificationConfigBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.PushNotificationConfig, io.a2a.grpc.PushNotificationConfig.Builder, io.a2a.grpc.PushNotificationConfigOrBuilder>( + getPushNotificationConfig(), + getParentForChildren(), + isClean()); + pushNotificationConfig_ = null; + } + return pushNotificationConfigBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.TaskPushNotificationConfig) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.TaskPushNotificationConfig) + private static final io.a2a.grpc.TaskPushNotificationConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.TaskPushNotificationConfig(); + } + + public static io.a2a.grpc.TaskPushNotificationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskPushNotificationConfig 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 io.a2a.grpc.TaskPushNotificationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskPushNotificationConfigOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/TaskPushNotificationConfigOrBuilder.java new file mode 100644 index 000000000..923cdb062 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskPushNotificationConfigOrBuilder.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface TaskPushNotificationConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.TaskPushNotificationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name=tasks/{id}/pushNotificationConfigs/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + * @return Whether the pushNotificationConfig field is set. + */ + boolean hasPushNotificationConfig(); + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + * @return The pushNotificationConfig. + */ + io.a2a.grpc.PushNotificationConfig getPushNotificationConfig(); + /** + * .a2a.v1.PushNotificationConfig push_notification_config = 2 [json_name = "pushNotificationConfig"]; + */ + io.a2a.grpc.PushNotificationConfigOrBuilder getPushNotificationConfigOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/TaskState.java b/grpc/src/main/java/io/a2a/grpc/TaskState.java new file mode 100644 index 000000000..e6c361966 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskState.java @@ -0,0 +1,268 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * The set of states a Task can be in.
+ * 
+ * + * Protobuf enum {@code a2a.v1.TaskState} + */ +@com.google.protobuf.Generated +public enum TaskState + implements com.google.protobuf.ProtocolMessageEnum { + /** + * TASK_STATE_UNSPECIFIED = 0; + */ + TASK_STATE_UNSPECIFIED(0), + /** + *
+   * Represents the status that acknowledges a task is created
+   * 
+ * + * TASK_STATE_SUBMITTED = 1; + */ + TASK_STATE_SUBMITTED(1), + /** + *
+   * Represents the status that a task is actively being processed
+   * 
+ * + * TASK_STATE_WORKING = 2; + */ + TASK_STATE_WORKING(2), + /** + *
+   * Represents the status a task is finished. This is a terminal state
+   * 
+ * + * TASK_STATE_COMPLETED = 3; + */ + TASK_STATE_COMPLETED(3), + /** + *
+   * Represents the status a task is done but failed. This is a terminal state
+   * 
+ * + * TASK_STATE_FAILED = 4; + */ + TASK_STATE_FAILED(4), + /** + *
+   * Represents the status a task was cancelled before it finished.
+   * This is a terminal state.
+   * 
+ * + * TASK_STATE_CANCELLED = 5; + */ + TASK_STATE_CANCELLED(5), + /** + *
+   * Represents the status that the task requires information to complete.
+   * This is an interrupted state.
+   * 
+ * + * TASK_STATE_INPUT_REQUIRED = 6; + */ + TASK_STATE_INPUT_REQUIRED(6), + /** + *
+   * Represents the status that the agent has decided to not perform the task.
+   * This may be done during initial task creation or later once an agent
+   * has determined it can't or won't proceed. This is a terminal state.
+   * 
+ * + * TASK_STATE_REJECTED = 7; + */ + TASK_STATE_REJECTED(7), + /** + *
+   * Represents the state that some authentication is needed from the upstream
+   * client. Authentication is expected to come out-of-band thus this is not
+   * an interrupted or terminal state.
+   * 
+ * + * TASK_STATE_AUTH_REQUIRED = 8; + */ + TASK_STATE_AUTH_REQUIRED(8), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + TaskState.class.getName()); + } + /** + * TASK_STATE_UNSPECIFIED = 0; + */ + public static final int TASK_STATE_UNSPECIFIED_VALUE = 0; + /** + *
+   * Represents the status that acknowledges a task is created
+   * 
+ * + * TASK_STATE_SUBMITTED = 1; + */ + public static final int TASK_STATE_SUBMITTED_VALUE = 1; + /** + *
+   * Represents the status that a task is actively being processed
+   * 
+ * + * TASK_STATE_WORKING = 2; + */ + public static final int TASK_STATE_WORKING_VALUE = 2; + /** + *
+   * Represents the status a task is finished. This is a terminal state
+   * 
+ * + * TASK_STATE_COMPLETED = 3; + */ + public static final int TASK_STATE_COMPLETED_VALUE = 3; + /** + *
+   * Represents the status a task is done but failed. This is a terminal state
+   * 
+ * + * TASK_STATE_FAILED = 4; + */ + public static final int TASK_STATE_FAILED_VALUE = 4; + /** + *
+   * Represents the status a task was cancelled before it finished.
+   * This is a terminal state.
+   * 
+ * + * TASK_STATE_CANCELLED = 5; + */ + public static final int TASK_STATE_CANCELLED_VALUE = 5; + /** + *
+   * Represents the status that the task requires information to complete.
+   * This is an interrupted state.
+   * 
+ * + * TASK_STATE_INPUT_REQUIRED = 6; + */ + public static final int TASK_STATE_INPUT_REQUIRED_VALUE = 6; + /** + *
+   * Represents the status that the agent has decided to not perform the task.
+   * This may be done during initial task creation or later once an agent
+   * has determined it can't or won't proceed. This is a terminal state.
+   * 
+ * + * TASK_STATE_REJECTED = 7; + */ + public static final int TASK_STATE_REJECTED_VALUE = 7; + /** + *
+   * Represents the state that some authentication is needed from the upstream
+   * client. Authentication is expected to come out-of-band thus this is not
+   * an interrupted or terminal state.
+   * 
+ * + * TASK_STATE_AUTH_REQUIRED = 8; + */ + public static final int TASK_STATE_AUTH_REQUIRED_VALUE = 8; + + + 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 TaskState 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 TaskState forNumber(int value) { + switch (value) { + case 0: return TASK_STATE_UNSPECIFIED; + case 1: return TASK_STATE_SUBMITTED; + case 2: return TASK_STATE_WORKING; + case 3: return TASK_STATE_COMPLETED; + case 4: return TASK_STATE_FAILED; + case 5: return TASK_STATE_CANCELLED; + case 6: return TASK_STATE_INPUT_REQUIRED; + case 7: return TASK_STATE_REJECTED; + case 8: return TASK_STATE_AUTH_REQUIRED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + TaskState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TaskState findValueByNumber(int number) { + return TaskState.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 com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.a2a.grpc.A2A.getDescriptor().getEnumTypes().get(0); + } + + private static final TaskState[] VALUES = values(); + + public static TaskState 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 TaskState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:a2a.v1.TaskState) +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskStatus.java b/grpc/src/main/java/io/a2a/grpc/TaskStatus.java new file mode 100644 index 000000000..5ff2e72a7 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskStatus.java @@ -0,0 +1,980 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * A container for the status of a task
+ * 
+ * + * Protobuf type {@code a2a.v1.TaskStatus} + */ +@com.google.protobuf.Generated +public final class TaskStatus extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.TaskStatus) + TaskStatusOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + TaskStatus.class.getName()); + } + // Use TaskStatus.newBuilder() to construct. + private TaskStatus(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaskStatus() { + state_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskStatus.class, io.a2a.grpc.TaskStatus.Builder.class); + } + + private int bitField0_; + public static final int STATE_FIELD_NUMBER = 1; + private int state_ = 0; + /** + *
+   * The current state of this task
+   * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override public int getStateValue() { + return state_; + } + /** + *
+   * The current state of this task
+   * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override public io.a2a.grpc.TaskState getState() { + io.a2a.grpc.TaskState result = io.a2a.grpc.TaskState.forNumber(state_); + return result == null ? io.a2a.grpc.TaskState.UNRECOGNIZED : result; + } + + public static final int UPDATE_FIELD_NUMBER = 2; + private io.a2a.grpc.Message update_; + /** + *
+   * A message associated with the status.
+   * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + * @return Whether the update field is set. + */ + @java.lang.Override + public boolean hasUpdate() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * A message associated with the status.
+   * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + * @return The update. + */ + @java.lang.Override + public io.a2a.grpc.Message getUpdate() { + return update_ == null ? io.a2a.grpc.Message.getDefaultInstance() : update_; + } + /** + *
+   * A message associated with the status.
+   * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + @java.lang.Override + public io.a2a.grpc.MessageOrBuilder getUpdateOrBuilder() { + return update_ == null ? io.a2a.grpc.Message.getDefaultInstance() : update_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp timestamp_; + /** + *
+   * Timestamp when the status was recorded.
+   * Example: "2023-10-27T10:00:00Z"
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * Timestamp when the status was recorded.
+   * Example: "2023-10-27T10:00:00Z"
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + *
+   * Timestamp when the status was recorded.
+   * Example: "2023-10-27T10:00:00Z"
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + 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 (state_ != io.a2a.grpc.TaskState.TASK_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, state_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getUpdate()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getTimestamp()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (state_ != io.a2a.grpc.TaskState.TASK_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, state_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdate()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTimestamp()); + } + 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 io.a2a.grpc.TaskStatus)) { + return super.equals(obj); + } + io.a2a.grpc.TaskStatus other = (io.a2a.grpc.TaskStatus) obj; + + if (state_ != other.state_) return false; + if (hasUpdate() != other.hasUpdate()) return false; + if (hasUpdate()) { + if (!getUpdate() + .equals(other.getUpdate())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasUpdate()) { + hash = (37 * hash) + UPDATE_FIELD_NUMBER; + hash = (53 * hash) + getUpdate().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.TaskStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskStatus parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.TaskStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.TaskStatus parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.TaskStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.TaskStatus 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A container for the status of a task
+   * 
+ * + * Protobuf type {@code a2a.v1.TaskStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.TaskStatus) + io.a2a.grpc.TaskStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskStatus.class, io.a2a.grpc.TaskStatus.Builder.class); + } + + // Construct using io.a2a.grpc.TaskStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetUpdateFieldBuilder(); + internalGetTimestampFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + state_ = 0; + update_ = null; + if (updateBuilder_ != null) { + updateBuilder_.dispose(); + updateBuilder_ = null; + } + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatus_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.TaskStatus getDefaultInstanceForType() { + return io.a2a.grpc.TaskStatus.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.TaskStatus build() { + io.a2a.grpc.TaskStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.TaskStatus buildPartial() { + io.a2a.grpc.TaskStatus result = new io.a2a.grpc.TaskStatus(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.TaskStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.state_ = state_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.update_ = updateBuilder_ == null + ? update_ + : updateBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestamp_ = timestampBuilder_ == null + ? timestamp_ + : timestampBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.TaskStatus) { + return mergeFrom((io.a2a.grpc.TaskStatus)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.TaskStatus other) { + if (other == io.a2a.grpc.TaskStatus.getDefaultInstance()) return this; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasUpdate()) { + mergeUpdate(other.getUpdate()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + 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 8: { + state_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + internalGetUpdateFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetTimestampFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + 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 int state_ = 0; + /** + *
+     * The current state of this task
+     * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override public int getStateValue() { + return state_; + } + /** + *
+     * The current state of this task
+     * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The current state of this task
+     * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return The state. + */ + @java.lang.Override + public io.a2a.grpc.TaskState getState() { + io.a2a.grpc.TaskState result = io.a2a.grpc.TaskState.forNumber(state_); + return result == null ? io.a2a.grpc.TaskState.UNRECOGNIZED : result; + } + /** + *
+     * The current state of this task
+     * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(io.a2a.grpc.TaskState value) { + if (value == null) { throw new NullPointerException(); } + bitField0_ |= 0x00000001; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The current state of this task
+     * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000001); + state_ = 0; + onChanged(); + return this; + } + + private io.a2a.grpc.Message update_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> updateBuilder_; + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + * @return Whether the update field is set. + */ + public boolean hasUpdate() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + * @return The update. + */ + public io.a2a.grpc.Message getUpdate() { + if (updateBuilder_ == null) { + return update_ == null ? io.a2a.grpc.Message.getDefaultInstance() : update_; + } else { + return updateBuilder_.getMessage(); + } + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + public Builder setUpdate(io.a2a.grpc.Message value) { + if (updateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + update_ = value; + } else { + updateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + public Builder setUpdate( + io.a2a.grpc.Message.Builder builderForValue) { + if (updateBuilder_ == null) { + update_ = builderForValue.build(); + } else { + updateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + public Builder mergeUpdate(io.a2a.grpc.Message value) { + if (updateBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + update_ != null && + update_ != io.a2a.grpc.Message.getDefaultInstance()) { + getUpdateBuilder().mergeFrom(value); + } else { + update_ = value; + } + } else { + updateBuilder_.mergeFrom(value); + } + if (update_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + public Builder clearUpdate() { + bitField0_ = (bitField0_ & ~0x00000002); + update_ = null; + if (updateBuilder_ != null) { + updateBuilder_.dispose(); + updateBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + public io.a2a.grpc.Message.Builder getUpdateBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateFieldBuilder().getBuilder(); + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + public io.a2a.grpc.MessageOrBuilder getUpdateOrBuilder() { + if (updateBuilder_ != null) { + return updateBuilder_.getMessageOrBuilder(); + } else { + return update_ == null ? + io.a2a.grpc.Message.getDefaultInstance() : update_; + } + } + /** + *
+     * A message associated with the status.
+     * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder> + internalGetUpdateFieldBuilder() { + if (updateBuilder_ == null) { + updateBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.Message, io.a2a.grpc.Message.Builder, io.a2a.grpc.MessageOrBuilder>( + getUpdate(), + getParentForChildren(), + isClean()); + update_ = null; + } + return updateBuilder_; + } + + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetTimestampFieldBuilder().getBuilder(); + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + *
+     * Timestamp when the status was recorded.
+     * Example: "2023-10-27T10:00:00Z"
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + internalGetTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.TaskStatus) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.TaskStatus) + private static final io.a2a.grpc.TaskStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.TaskStatus(); + } + + public static io.a2a.grpc.TaskStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskStatus 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 io.a2a.grpc.TaskStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskStatusOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/TaskStatusOrBuilder.java new file mode 100644 index 000000000..2fc574154 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskStatusOrBuilder.java @@ -0,0 +1,88 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface TaskStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.TaskStatus) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The current state of this task
+   * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + *
+   * The current state of this task
+   * 
+ * + * .a2a.v1.TaskState state = 1 [json_name = "state"]; + * @return The state. + */ + io.a2a.grpc.TaskState getState(); + + /** + *
+   * A message associated with the status.
+   * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + * @return Whether the update field is set. + */ + boolean hasUpdate(); + /** + *
+   * A message associated with the status.
+   * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + * @return The update. + */ + io.a2a.grpc.Message getUpdate(); + /** + *
+   * A message associated with the status.
+   * 
+ * + * .a2a.v1.Message update = 2 [json_name = "message"]; + */ + io.a2a.grpc.MessageOrBuilder getUpdateOrBuilder(); + + /** + *
+   * Timestamp when the status was recorded.
+   * Example: "2023-10-27T10:00:00Z"
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + *
+   * Timestamp when the status was recorded.
+   * Example: "2023-10-27T10:00:00Z"
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + /** + *
+   * Timestamp when the status was recorded.
+   * Example: "2023-10-27T10:00:00Z"
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 3 [json_name = "timestamp"]; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/TaskStatusUpdateEvent.java b/grpc/src/main/java/io/a2a/grpc/TaskStatusUpdateEvent.java new file mode 100644 index 000000000..61cf2a157 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskStatusUpdateEvent.java @@ -0,0 +1,1261 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + *
+ * TaskStatusUpdateEvent is a delta even on a task indicating that a task
+ * has changed.
+ * 
+ * + * Protobuf type {@code a2a.v1.TaskStatusUpdateEvent} + */ +@com.google.protobuf.Generated +public final class TaskStatusUpdateEvent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.TaskStatusUpdateEvent) + TaskStatusUpdateEventOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + TaskStatusUpdateEvent.class.getName()); + } + // Use TaskStatusUpdateEvent.newBuilder() to construct. + private TaskStatusUpdateEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaskStatusUpdateEvent() { + taskId_ = ""; + contextId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatusUpdateEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatusUpdateEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskStatusUpdateEvent.class, io.a2a.grpc.TaskStatusUpdateEvent.Builder.class); + } + + private int bitField0_; + public static final int TASK_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object taskId_ = ""; + /** + *
+   * The id of the task that is changed
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The taskId. + */ + @java.lang.Override + public java.lang.String getTaskId() { + java.lang.Object ref = taskId_; + 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(); + taskId_ = s; + return s; + } + } + /** + *
+   * The id of the task that is changed
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTaskIdBytes() { + java.lang.Object ref = taskId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object contextId_ = ""; + /** + *
+   * The id of the context that the task belongs to
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + @java.lang.Override + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + 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(); + contextId_ = s; + return s; + } + } + /** + *
+   * The id of the context that the task belongs to
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 3; + private io.a2a.grpc.TaskStatus status_; + /** + *
+   * The new status of the task.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+   * The new status of the task.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return The status. + */ + @java.lang.Override + public io.a2a.grpc.TaskStatus getStatus() { + return status_ == null ? io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } + /** + *
+   * The new status of the task.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + @java.lang.Override + public io.a2a.grpc.TaskStatusOrBuilder getStatusOrBuilder() { + return status_ == null ? io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } + + public static final int FINAL_FIELD_NUMBER = 4; + private boolean final_ = false; + /** + *
+   * Whether this is the last status update expected for this task.
+   * 
+ * + * bool final = 4 [json_name = "final"]; + * @return The final. + */ + @java.lang.Override + public boolean getFinal() { + return final_; + } + + public static final int METADATA_FIELD_NUMBER = 5; + private com.google.protobuf.Struct metadata_; + /** + *
+   * Optional metadata to associate with the task update.
+   * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+   * Optional metadata to associate with the task update.
+   * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + * @return The metadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getMetadata() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + /** + *
+   * Optional metadata to associate with the task update.
+   * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + + 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.GeneratedMessage.isStringEmpty(taskId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, taskId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, contextId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getStatus()); + } + if (final_ != false) { + output.writeBool(4, final_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(taskId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, taskId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contextId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, contextId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getStatus()); + } + if (final_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, final_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getMetadata()); + } + 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 io.a2a.grpc.TaskStatusUpdateEvent)) { + return super.equals(obj); + } + io.a2a.grpc.TaskStatusUpdateEvent other = (io.a2a.grpc.TaskStatusUpdateEvent) obj; + + if (!getTaskId() + .equals(other.getTaskId())) return false; + if (!getContextId() + .equals(other.getContextId())) return false; + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus() + .equals(other.getStatus())) return false; + } + if (getFinal() + != other.getFinal()) return false; + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) 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) + TASK_ID_FIELD_NUMBER; + hash = (53 * hash) + getTaskId().hashCode(); + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (37 * hash) + FINAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinal()); + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.TaskStatusUpdateEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.TaskStatusUpdateEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskStatusUpdateEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.TaskStatusUpdateEvent 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * TaskStatusUpdateEvent is a delta even on a task indicating that a task
+   * has changed.
+   * 
+ * + * Protobuf type {@code a2a.v1.TaskStatusUpdateEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.TaskStatusUpdateEvent) + io.a2a.grpc.TaskStatusUpdateEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatusUpdateEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatusUpdateEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskStatusUpdateEvent.class, io.a2a.grpc.TaskStatusUpdateEvent.Builder.class); + } + + // Construct using io.a2a.grpc.TaskStatusUpdateEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + internalGetMetadataFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + taskId_ = ""; + contextId_ = ""; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + final_ = false; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskStatusUpdateEvent_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEvent getDefaultInstanceForType() { + return io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEvent build() { + io.a2a.grpc.TaskStatusUpdateEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.TaskStatusUpdateEvent buildPartial() { + io.a2a.grpc.TaskStatusUpdateEvent result = new io.a2a.grpc.TaskStatusUpdateEvent(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.TaskStatusUpdateEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.taskId_ = taskId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contextId_ = contextId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = statusBuilder_ == null + ? status_ + : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.final_ = final_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.metadata_ = metadataBuilder_ == null + ? metadata_ + : metadataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.TaskStatusUpdateEvent) { + return mergeFrom((io.a2a.grpc.TaskStatusUpdateEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.TaskStatusUpdateEvent other) { + if (other == io.a2a.grpc.TaskStatusUpdateEvent.getDefaultInstance()) return this; + if (!other.getTaskId().isEmpty()) { + taskId_ = other.taskId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContextId().isEmpty()) { + contextId_ = other.contextId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.getFinal() != false) { + setFinal(other.getFinal()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + 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: { + taskId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + contextId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + input.readMessage( + internalGetStatusFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: { + final_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: { + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), + extensionRegistry); + 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 taskId_ = ""; + /** + *
+     * The id of the task that is changed
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The taskId. + */ + public java.lang.String getTaskId() { + java.lang.Object ref = taskId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The id of the task that is changed
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + public com.google.protobuf.ByteString + getTaskIdBytes() { + java.lang.Object ref = taskId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The id of the task that is changed
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @param value The taskId to set. + * @return This builder for chaining. + */ + public Builder setTaskId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + taskId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * The id of the task that is changed
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return This builder for chaining. + */ + public Builder clearTaskId() { + taskId_ = getDefaultInstance().getTaskId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The id of the task that is changed
+     * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @param value The bytes for taskId to set. + * @return This builder for chaining. + */ + public Builder setTaskIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + taskId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contextId_ = ""; + /** + *
+     * The id of the context that the task belongs to
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + public java.lang.String getContextId() { + java.lang.Object ref = contextId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contextId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The id of the context that the task belongs to
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + public com.google.protobuf.ByteString + getContextIdBytes() { + java.lang.Object ref = contextId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contextId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The id of the context that the task belongs to
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The contextId to set. + * @return This builder for chaining. + */ + public Builder setContextId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+     * The id of the context that the task belongs to
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return This builder for chaining. + */ + public Builder clearContextId() { + contextId_ = getDefaultInstance().getContextId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The id of the context that the task belongs to
+     * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @param value The bytes for contextId to set. + * @return This builder for chaining. + */ + public Builder setContextIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + contextId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private io.a2a.grpc.TaskStatus status_; + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatus, io.a2a.grpc.TaskStatus.Builder, io.a2a.grpc.TaskStatusOrBuilder> statusBuilder_; + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return The status. + */ + public io.a2a.grpc.TaskStatus getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder setStatus(io.a2a.grpc.TaskStatus value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder setStatus( + io.a2a.grpc.TaskStatus.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder mergeStatus(io.a2a.grpc.TaskStatus value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) && + status_ != null && + status_ != io.a2a.grpc.TaskStatus.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public io.a2a.grpc.TaskStatus.Builder getStatusBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + public io.a2a.grpc.TaskStatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? + io.a2a.grpc.TaskStatus.getDefaultInstance() : status_; + } + } + /** + *
+     * The new status of the task.
+     * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatus, io.a2a.grpc.TaskStatus.Builder, io.a2a.grpc.TaskStatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.a2a.grpc.TaskStatus, io.a2a.grpc.TaskStatus.Builder, io.a2a.grpc.TaskStatusOrBuilder>( + getStatus(), + getParentForChildren(), + isClean()); + status_ = null; + } + return statusBuilder_; + } + + private boolean final_ ; + /** + *
+     * Whether this is the last status update expected for this task.
+     * 
+ * + * bool final = 4 [json_name = "final"]; + * @return The final. + */ + @java.lang.Override + public boolean getFinal() { + return final_; + } + /** + *
+     * Whether this is the last status update expected for this task.
+     * 
+ * + * bool final = 4 [json_name = "final"]; + * @param value The final to set. + * @return This builder for chaining. + */ + public Builder setFinal(boolean value) { + + final_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+     * Whether this is the last status update expected for this task.
+     * 
+ * + * bool final = 4 [json_name = "final"]; + * @return This builder for chaining. + */ + public Builder clearFinal() { + bitField0_ = (bitField0_ & ~0x00000008); + final_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Struct metadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + * @return The metadata. + */ + public com.google.protobuf.Struct getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + public Builder setMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + } else { + metadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + public Builder setMetadata( + com.google.protobuf.Struct.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + public Builder mergeMetadata(com.google.protobuf.Struct value) { + if (metadataBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + metadata_ != null && + metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); + } else { + metadata_ = value; + } + } else { + metadataBuilder_.mergeFrom(value); + } + if (metadata_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000010); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); + metadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + public com.google.protobuf.Struct.Builder getMetadataBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.protobuf.Struct.getDefaultInstance() : metadata_; + } + } + /** + *
+     * Optional metadata to associate with the task update.
+     * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> + internalGetMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.TaskStatusUpdateEvent) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.TaskStatusUpdateEvent) + private static final io.a2a.grpc.TaskStatusUpdateEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.TaskStatusUpdateEvent(); + } + + public static io.a2a.grpc.TaskStatusUpdateEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskStatusUpdateEvent 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 io.a2a.grpc.TaskStatusUpdateEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskStatusUpdateEventOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/TaskStatusUpdateEventOrBuilder.java new file mode 100644 index 000000000..42fd0d67f --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskStatusUpdateEventOrBuilder.java @@ -0,0 +1,116 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface TaskStatusUpdateEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.TaskStatusUpdateEvent) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The id of the task that is changed
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The taskId. + */ + java.lang.String getTaskId(); + /** + *
+   * The id of the task that is changed
+   * 
+ * + * string task_id = 1 [json_name = "taskId"]; + * @return The bytes for taskId. + */ + com.google.protobuf.ByteString + getTaskIdBytes(); + + /** + *
+   * The id of the context that the task belongs to
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The contextId. + */ + java.lang.String getContextId(); + /** + *
+   * The id of the context that the task belongs to
+   * 
+ * + * string context_id = 2 [json_name = "contextId"]; + * @return The bytes for contextId. + */ + com.google.protobuf.ByteString + getContextIdBytes(); + + /** + *
+   * The new status of the task.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return Whether the status field is set. + */ + boolean hasStatus(); + /** + *
+   * The new status of the task.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + * @return The status. + */ + io.a2a.grpc.TaskStatus getStatus(); + /** + *
+   * The new status of the task.
+   * 
+ * + * .a2a.v1.TaskStatus status = 3 [json_name = "status"]; + */ + io.a2a.grpc.TaskStatusOrBuilder getStatusOrBuilder(); + + /** + *
+   * Whether this is the last status update expected for this task.
+   * 
+ * + * bool final = 4 [json_name = "final"]; + * @return The final. + */ + boolean getFinal(); + + /** + *
+   * Optional metadata to associate with the task update.
+   * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * Optional metadata to associate with the task update.
+   * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + * @return The metadata. + */ + com.google.protobuf.Struct getMetadata(); + /** + *
+   * Optional metadata to associate with the task update.
+   * 
+ * + * .google.protobuf.Struct metadata = 5 [json_name = "metadata"]; + */ + com.google.protobuf.StructOrBuilder getMetadataOrBuilder(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/TaskSubscriptionRequest.java b/grpc/src/main/java/io/a2a/grpc/TaskSubscriptionRequest.java new file mode 100644 index 000000000..5f4020608 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskSubscriptionRequest.java @@ -0,0 +1,530 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +/** + * Protobuf type {@code a2a.v1.TaskSubscriptionRequest} + */ +@com.google.protobuf.Generated +public final class TaskSubscriptionRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:a2a.v1.TaskSubscriptionRequest) + TaskSubscriptionRequestOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 31, + /* patch= */ 1, + /* suffix= */ "", + TaskSubscriptionRequest.class.getName()); + } + // Use TaskSubscriptionRequest.newBuilder() to construct. + private TaskSubscriptionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private TaskSubscriptionRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskSubscriptionRequest.class, io.a2a.grpc.TaskSubscriptionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.TaskSubscriptionRequest)) { + return super.equals(obj); + } + io.a2a.grpc.TaskSubscriptionRequest other = (io.a2a.grpc.TaskSubscriptionRequest) 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 io.a2a.grpc.TaskSubscriptionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.a2a.grpc.TaskSubscriptionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.a2a.grpc.TaskSubscriptionRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.a2a.grpc.TaskSubscriptionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.a2a.grpc.TaskSubscriptionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code a2a.v1.TaskSubscriptionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:a2a.v1.TaskSubscriptionRequest) + io.a2a.grpc.TaskSubscriptionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskSubscriptionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.a2a.grpc.A2A.internal_static_a2a_v1_TaskSubscriptionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.a2a.grpc.TaskSubscriptionRequest.class, io.a2a.grpc.TaskSubscriptionRequest.Builder.class); + } + + // Construct using io.a2a.grpc.TaskSubscriptionRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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 io.a2a.grpc.A2A.internal_static_a2a_v1_TaskSubscriptionRequest_descriptor; + } + + @java.lang.Override + public io.a2a.grpc.TaskSubscriptionRequest getDefaultInstanceForType() { + return io.a2a.grpc.TaskSubscriptionRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.a2a.grpc.TaskSubscriptionRequest build() { + io.a2a.grpc.TaskSubscriptionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.a2a.grpc.TaskSubscriptionRequest buildPartial() { + io.a2a.grpc.TaskSubscriptionRequest result = new io.a2a.grpc.TaskSubscriptionRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.a2a.grpc.TaskSubscriptionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.a2a.grpc.TaskSubscriptionRequest) { + return mergeFrom((io.a2a.grpc.TaskSubscriptionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.a2a.grpc.TaskSubscriptionRequest other) { + if (other == io.a2a.grpc.TaskSubscriptionRequest.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_ = ""; + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * name=tasks/{id}
+     * 
+ * + * string name = 1 [json_name = "name"]; + * @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; + } + + // @@protoc_insertion_point(builder_scope:a2a.v1.TaskSubscriptionRequest) + } + + // @@protoc_insertion_point(class_scope:a2a.v1.TaskSubscriptionRequest) + private static final io.a2a.grpc.TaskSubscriptionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.a2a.grpc.TaskSubscriptionRequest(); + } + + public static io.a2a.grpc.TaskSubscriptionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TaskSubscriptionRequest 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 io.a2a.grpc.TaskSubscriptionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/grpc/src/main/java/io/a2a/grpc/TaskSubscriptionRequestOrBuilder.java b/grpc/src/main/java/io/a2a/grpc/TaskSubscriptionRequestOrBuilder.java new file mode 100644 index 000000000..da8c0e621 --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/TaskSubscriptionRequestOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: a2a.proto +// Protobuf Java Version: 4.31.1 + +package io.a2a.grpc; + +@com.google.protobuf.Generated +public interface TaskSubscriptionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:a2a.v1.TaskSubscriptionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * name=tasks/{id}
+   * 
+ * + * string name = 1 [json_name = "name"]; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/grpc/src/main/java/io/a2a/grpc/utils/ProtoUtils.java b/grpc/src/main/java/io/a2a/grpc/utils/ProtoUtils.java new file mode 100644 index 000000000..a3e36ce3f --- /dev/null +++ b/grpc/src/main/java/io/a2a/grpc/utils/ProtoUtils.java @@ -0,0 +1,871 @@ +package io.a2a.grpc.utils; + +import java.nio.charset.StandardCharsets; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.google.protobuf.ByteString; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; + +import io.a2a.grpc.StreamResponse; +import io.a2a.spec.APIKeySecurityScheme; +import io.a2a.spec.AgentCapabilities; +import io.a2a.spec.AgentCard; +import io.a2a.spec.AgentExtension; +import io.a2a.spec.AgentInterface; +import io.a2a.spec.AgentProvider; +import io.a2a.spec.AgentSkill; +import io.a2a.spec.Artifact; +import io.a2a.spec.AuthorizationCodeOAuthFlow; +import io.a2a.spec.ClientCredentialsOAuthFlow; +import io.a2a.spec.DataPart; +import io.a2a.spec.DeleteTaskPushNotificationConfigParams; +import io.a2a.spec.EventKind; +import io.a2a.spec.FileContent; +import io.a2a.spec.FilePart; +import io.a2a.spec.FileWithBytes; +import io.a2a.spec.FileWithUri; +import io.a2a.spec.GetTaskPushNotificationConfigParams; +import io.a2a.spec.HTTPAuthSecurityScheme; +import io.a2a.spec.ImplicitOAuthFlow; +import io.a2a.spec.ListTaskPushNotificationConfigParams; +import io.a2a.spec.Message; +import io.a2a.spec.MessageSendConfiguration; +import io.a2a.spec.MessageSendParams; +import io.a2a.spec.OAuth2SecurityScheme; +import io.a2a.spec.OAuthFlows; +import io.a2a.spec.OpenIdConnectSecurityScheme; +import io.a2a.spec.Part; +import io.a2a.spec.PasswordOAuthFlow; +import io.a2a.spec.PushNotificationAuthenticationInfo; +import io.a2a.spec.PushNotificationConfig; +import io.a2a.spec.SecurityScheme; +import io.a2a.spec.StreamingEventKind; +import io.a2a.spec.Task; +import io.a2a.spec.TaskArtifactUpdateEvent; +import io.a2a.spec.TaskIdParams; +import io.a2a.spec.TaskPushNotificationConfig; +import io.a2a.spec.TaskQueryParams; +import io.a2a.spec.TaskState; +import io.a2a.spec.TaskStatus; +import io.a2a.spec.TaskStatusUpdateEvent; +import io.a2a.spec.TextPart; + +/** + * Utility class to convert between GRPC and Spec objects. + */ +public class ProtoUtils { + public static class ToProto { + + public static io.a2a.grpc.AgentCard agentCard(AgentCard agentCard) { + io.a2a.grpc.AgentCard.Builder builder = io.a2a.grpc.AgentCard.newBuilder(); + if (agentCard.protocolVersion() != null) { + builder.setProtocolVersion(agentCard.protocolVersion()); + } + if (agentCard.name() != null) { + builder.setName(agentCard.name()); + } + if (agentCard.description() != null) { + builder.setDescription(agentCard.description()); + } + if (agentCard.url() != null) { + builder.setUrl(agentCard.url()); + } + if (agentCard.preferredTransport() != null) { + builder.setPreferredTransport(agentCard.preferredTransport()); + } + if (agentCard.additionalInterfaces() != null) { + builder.addAllAdditionalInterfaces(agentCard.additionalInterfaces().stream().map(item -> agentInterface(item)).collect(Collectors.toList())); + } + if (agentCard.provider() != null) { + builder.setProvider(agentProvider(agentCard.provider())); + } + if (agentCard.version() != null) { + builder.setVersion(agentCard.version()); + } + if (agentCard.documentationUrl() != null) { + builder.setDocumentationUrl(agentCard.documentationUrl()); + } + if (agentCard.capabilities() != null) { + builder.setCapabilities(agentCapabilities(agentCard.capabilities())); + } + if (agentCard.securitySchemes() != null) { + builder.putAllSecuritySchemes( + agentCard.securitySchemes().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, e -> securityScheme(e.getValue()))) + ); + } + if (agentCard.security() != null) { + builder.addAllSecurity(agentCard.security().stream().map(s -> { + io.a2a.grpc.Security.Builder securityBuilder = io.a2a.grpc.Security.newBuilder(); + s.forEach((key, value) -> { + io.a2a.grpc.StringList.Builder stringListBuilder = io.a2a.grpc.StringList.newBuilder(); + stringListBuilder.addAllList(value); + securityBuilder.putSchemes(key, stringListBuilder.build()); + }); + return securityBuilder.build(); + }).collect(Collectors.toList())); + } + if (agentCard.defaultInputModes() != null) { + builder.addAllDefaultInputModes(agentCard.defaultInputModes()); + } + if (agentCard.defaultOutputModes() != null) { + builder.addAllDefaultOutputModes(agentCard.defaultOutputModes()); + } + if (agentCard.skills() != null) { + builder.addAllSkills(agentCard.skills().stream().map(ToProto::agentSkill).collect(Collectors.toList())); + } + builder.setSupportsAuthenticatedExtendedCard(agentCard.supportsAuthenticatedExtendedCard()); + return builder.build(); + } + + public static io.a2a.grpc.Task task(Task task) { + io.a2a.grpc.Task.Builder builder = io.a2a.grpc.Task.newBuilder(); + builder.setId(task.getId()); + builder.setContextId(task.getContextId()); + builder.setStatus(taskStatus(task.getStatus())); + if (task.getArtifacts() != null) { + builder.addAllArtifacts(task.getArtifacts().stream().map(ToProto::artifact).collect(Collectors.toList())); + } + if (task.getHistory() != null) { + builder.addAllHistory(task.getHistory().stream().map(ToProto::message).collect(Collectors.toList())); + } + builder.setMetadata(struct(task.getMetadata())); + return builder.build(); + } + + public static io.a2a.grpc.Message message(Message message) { + io.a2a.grpc.Message.Builder builder = io.a2a.grpc.Message.newBuilder(); + builder.setMessageId(message.getMessageId()); + builder.setContextId(message.getContextId()); + builder.setTaskId(message.getTaskId()); + builder.setRole(role(message.getRole())); + if (message.getParts() != null) { + builder.addAllContent(message.getParts().stream().map(ToProto::part).collect(Collectors.toList())); + } + builder.setMetadata(struct(message.getMetadata())); + return builder.build(); + } + + public static io.a2a.grpc.TaskPushNotificationConfig taskPushNotificationConfig(TaskPushNotificationConfig config) { + io.a2a.grpc.TaskPushNotificationConfig.Builder builder = io.a2a.grpc.TaskPushNotificationConfig.newBuilder(); + builder.setName("tasks/" + config.taskId() + "/pushNotificationConfigs/" + config.pushNotificationConfig().id()); + builder.setPushNotificationConfig(pushNotificationConfig(config.pushNotificationConfig())); + return builder.build(); + } + + private static io.a2a.grpc.PushNotificationConfig pushNotificationConfig(PushNotificationConfig config) { + io.a2a.grpc.PushNotificationConfig.Builder builder = io.a2a.grpc.PushNotificationConfig.newBuilder(); + if (config.url() != null) { + builder.setUrl(config.url()); + } + if (config.token() != null) { + builder.setToken(config.token()); + } + if (config.authentication() != null) { + builder.setAuthentication(authenticationInfo(config.authentication())); + } + if (config.id() != null) { + builder.setId(config.id()); + } + return builder.build(); + } + + public static io.a2a.grpc.TaskArtifactUpdateEvent taskArtifactUpdateEvent(TaskArtifactUpdateEvent event) { + io.a2a.grpc.TaskArtifactUpdateEvent.Builder builder = io.a2a.grpc.TaskArtifactUpdateEvent.newBuilder(); + builder.setTaskId(event.getTaskId()); + builder.setContextId(event.getContextId()); + builder.setArtifact(artifact(event.getArtifact())); + builder.setAppend(event.isAppend() == null ? false : event.isAppend()); + builder.setLastChunk(event.isLastChunk() == null ? false : event.isLastChunk()); + if (event.getMetadata() != null) { + builder.setMetadata(struct(event.getMetadata())); + } + return builder.build(); + } + + public static io.a2a.grpc.TaskStatusUpdateEvent taskStatusUpdateEvent(TaskStatusUpdateEvent event) { + io.a2a.grpc.TaskStatusUpdateEvent.Builder builder = io.a2a.grpc.TaskStatusUpdateEvent.newBuilder(); + builder.setTaskId(event.getTaskId()); + builder.setContextId(event.getContextId()); + builder.setStatus(taskStatus(event.getStatus())); + builder.setFinal(event.isFinal()); + if (event.getMetadata() != null) { + builder.setMetadata(struct(event.getMetadata())); + } + return builder.build(); + } + + private static io.a2a.grpc.Artifact artifact(Artifact artifact) { + io.a2a.grpc.Artifact.Builder builder = io.a2a.grpc.Artifact.newBuilder(); + if (artifact.artifactId() != null) { + builder.setArtifactId(artifact.artifactId()); + } + if (artifact.name() != null) { + builder.setName(artifact.name()); + } + if (artifact.description() != null) { + builder.setDescription(artifact.description()); + } + if (artifact.parts() != null) { + builder.addAllParts(artifact.parts().stream().map(ToProto::part).collect(Collectors.toList())); + } + if (artifact.metadata() != null) { + builder.setMetadata(struct(artifact.metadata())); + } + return builder.build(); + } + + private static io.a2a.grpc.Part part(Part part) { + io.a2a.grpc.Part.Builder builder = io.a2a.grpc.Part.newBuilder(); + if (part instanceof TextPart) { + builder.setText(((TextPart) part).getText()); + } else if (part instanceof FilePart) { + builder.setFile(filePart((FilePart) part)); + } else if (part instanceof DataPart) { + builder.setData(dataPart((DataPart) part)); + } + return builder.build(); + } + + private static io.a2a.grpc.FilePart filePart(FilePart filePart) { + io.a2a.grpc.FilePart.Builder builder = io.a2a.grpc.FilePart.newBuilder(); + FileContent fileContent = filePart.getFile(); + if (fileContent instanceof FileWithBytes) { + builder.setFileWithBytes(ByteString.copyFrom(((FileWithBytes) fileContent).bytes(), StandardCharsets.UTF_8)); + } else if (fileContent instanceof FileWithUri) { + builder.setFileWithUri(((FileWithUri) fileContent).uri()); + } + return builder.build(); + } + + private static io.a2a.grpc.DataPart dataPart(DataPart dataPart) { + io.a2a.grpc.DataPart.Builder builder = io.a2a.grpc.DataPart.newBuilder(); + if (dataPart.getData() != null) { + builder.setData(struct(dataPart.getData())); + } + return builder.build(); + } + + private static io.a2a.grpc.Role role(Message.Role role) { + if (role == null) { + return io.a2a.grpc.Role.ROLE_UNSPECIFIED; + } + return switch (role) { + case USER -> io.a2a.grpc.Role.ROLE_USER; + case AGENT -> io.a2a.grpc.Role.ROLE_AGENT; + }; + } + + private static io.a2a.grpc.TaskStatus taskStatus(TaskStatus taskStatus) { + io.a2a.grpc.TaskStatus.Builder builder = io.a2a.grpc.TaskStatus.newBuilder(); + if (taskStatus.state() != null) { + builder.setState(taskState(taskStatus.state())); + } + if (taskStatus.message() != null) { + builder.setUpdate(message(taskStatus.message())); + } + if (taskStatus.timestamp() != null) { + Instant instant = taskStatus.timestamp().toInstant(ZoneOffset.UTC); + builder.setTimestamp(com.google.protobuf.Timestamp.newBuilder().setSeconds(instant.getEpochSecond()).setNanos(instant.getNano()).build()); + } + return builder.build(); + } + + private static io.a2a.grpc.TaskState taskState(TaskState taskState) { + if (taskState == null) { + return io.a2a.grpc.TaskState.TASK_STATE_UNSPECIFIED; + } + return switch (taskState) { + case SUBMITTED -> io.a2a.grpc.TaskState.TASK_STATE_SUBMITTED; + case WORKING -> io.a2a.grpc.TaskState.TASK_STATE_WORKING; + case INPUT_REQUIRED -> io.a2a.grpc.TaskState.TASK_STATE_INPUT_REQUIRED; + case AUTH_REQUIRED -> io.a2a.grpc.TaskState.TASK_STATE_AUTH_REQUIRED; + case COMPLETED -> io.a2a.grpc.TaskState.TASK_STATE_COMPLETED; + case CANCELED -> io.a2a.grpc.TaskState.TASK_STATE_CANCELLED; + case FAILED -> io.a2a.grpc.TaskState.TASK_STATE_FAILED; + case REJECTED -> io.a2a.grpc.TaskState.TASK_STATE_REJECTED; + default -> io.a2a.grpc.TaskState.TASK_STATE_UNSPECIFIED; + }; + } + + private static io.a2a.grpc.AuthenticationInfo authenticationInfo(PushNotificationAuthenticationInfo pushNotificationAuthenticationInfo) { + io.a2a.grpc.AuthenticationInfo.Builder builder = io.a2a.grpc.AuthenticationInfo.newBuilder(); + if (pushNotificationAuthenticationInfo.schemes() != null) { + builder.addAllSchemes(pushNotificationAuthenticationInfo.schemes()); + } + if (pushNotificationAuthenticationInfo.credentials() != null) { + builder.setCredentials(pushNotificationAuthenticationInfo.credentials()); + } + return builder.build(); + } + + public static io.a2a.grpc.SendMessageConfiguration messageSendConfiguration(MessageSendConfiguration messageSendConfiguration) { + io.a2a.grpc.SendMessageConfiguration.Builder builder = io.a2a.grpc.SendMessageConfiguration.newBuilder(); + builder.addAllAcceptedOutputModes(messageSendConfiguration.acceptedOutputModes()); + if (messageSendConfiguration.historyLength() != null) { + builder.setHistoryLength(messageSendConfiguration.historyLength()); + } + if (messageSendConfiguration.pushNotification() != null) { + builder.setPushNotification(pushNotificationConfig(messageSendConfiguration.pushNotification())); + } + builder.setBlocking(messageSendConfiguration.blocking()); + return builder.build(); + } + + private static io.a2a.grpc.AgentProvider agentProvider(AgentProvider agentProvider) { + io.a2a.grpc.AgentProvider.Builder builder = io.a2a.grpc.AgentProvider.newBuilder(); + builder.setOrganization(agentProvider.organization()); + builder.setUrl(agentProvider.url()); + return builder.build(); + } + + private static io.a2a.grpc.AgentCapabilities agentCapabilities(AgentCapabilities agentCapabilities) { + io.a2a.grpc.AgentCapabilities.Builder builder = io.a2a.grpc.AgentCapabilities.newBuilder(); + builder.setStreaming(agentCapabilities.streaming()); + builder.setPushNotifications(agentCapabilities.pushNotifications()); + if (agentCapabilities.extensions() != null) { + builder.addAllExtensions(agentCapabilities.extensions().stream().map(ToProto::agentExtension).collect(Collectors.toList())); + } + return builder.build(); + } + + private static io.a2a.grpc.AgentExtension agentExtension(AgentExtension agentExtension) { + io.a2a.grpc.AgentExtension.Builder builder = io.a2a.grpc.AgentExtension.newBuilder(); + if (agentExtension.description() != null) { + builder.setDescription(agentExtension.description()); + } + if (agentExtension.params() != null) { + builder.setParams(struct(agentExtension.params())); + } + builder.setRequired(agentExtension.required()); + if (agentExtension.uri() != null) { + builder.setUri(agentExtension.uri()); + } + return builder.build(); + } + + private static io.a2a.grpc.AgentSkill agentSkill(AgentSkill agentSkill) { + io.a2a.grpc.AgentSkill.Builder builder = io.a2a.grpc.AgentSkill.newBuilder(); + if (agentSkill.id() != null) { + builder.setId(agentSkill.id()); + } + if (agentSkill.name() != null) { + builder.setName(agentSkill.name()); + } + if (agentSkill.description() != null) { + builder.setDescription(agentSkill.description()); + } + if (agentSkill.tags() != null) { + builder.addAllTags(agentSkill.tags()); + } + if (agentSkill.examples() != null) { + builder.addAllExamples(agentSkill.examples()); + } + if (agentSkill.inputModes() != null) { + builder.addAllInputModes(agentSkill.inputModes()); + } + if (agentSkill.outputModes() != null) { + builder.addAllOutputModes(agentSkill.outputModes()); + } + return builder.build(); + } + + private static io.a2a.grpc.SecurityScheme securityScheme(SecurityScheme securityScheme) { + io.a2a.grpc.SecurityScheme.Builder builder = io.a2a.grpc.SecurityScheme.newBuilder(); + if (securityScheme instanceof APIKeySecurityScheme) { + builder.setApiKeySecurityScheme(apiKeySecurityScheme((APIKeySecurityScheme) securityScheme)); + } else if (securityScheme instanceof HTTPAuthSecurityScheme) { + builder.setHttpAuthSecurityScheme(httpAuthSecurityScheme((HTTPAuthSecurityScheme) securityScheme)); + } else if (securityScheme instanceof OAuth2SecurityScheme) { + builder.setOauth2SecurityScheme(oauthSecurityScheme((OAuth2SecurityScheme) securityScheme)); + } else if (securityScheme instanceof OpenIdConnectSecurityScheme) { + builder.setOpenIdConnectSecurityScheme(openIdConnectSecurityScheme((OpenIdConnectSecurityScheme) securityScheme)); + } + return builder.build(); + } + + private static io.a2a.grpc.APIKeySecurityScheme apiKeySecurityScheme(APIKeySecurityScheme apiKeySecurityScheme) { + io.a2a.grpc.APIKeySecurityScheme.Builder builder = io.a2a.grpc.APIKeySecurityScheme.newBuilder(); + if (apiKeySecurityScheme.getDescription() != null) { + builder.setDescription(apiKeySecurityScheme.getDescription()); + } + if (apiKeySecurityScheme.getIn() != null) { + builder.setLocation(apiKeySecurityScheme.getIn()); + } + if (apiKeySecurityScheme.getName() != null) { + builder.setName(apiKeySecurityScheme.getName()); + } + return builder.build(); + } + + private static io.a2a.grpc.HTTPAuthSecurityScheme httpAuthSecurityScheme(HTTPAuthSecurityScheme httpAuthSecurityScheme) { + io.a2a.grpc.HTTPAuthSecurityScheme.Builder builder = io.a2a.grpc.HTTPAuthSecurityScheme.newBuilder(); + if (httpAuthSecurityScheme.getBearerFormat() != null) { + builder.setBearerFormat(httpAuthSecurityScheme.getBearerFormat()); + } + if (httpAuthSecurityScheme.getDescription() != null) { + builder.setDescription(httpAuthSecurityScheme.getDescription()); + } + if (httpAuthSecurityScheme.getScheme() != null) { + builder.setScheme(httpAuthSecurityScheme.getScheme()); + } + return builder.build(); + } + + private static io.a2a.grpc.OAuth2SecurityScheme oauthSecurityScheme(OAuth2SecurityScheme oauth2SecurityScheme) { + io.a2a.grpc.OAuth2SecurityScheme.Builder builder = io.a2a.grpc.OAuth2SecurityScheme.newBuilder(); + if (oauth2SecurityScheme.getDescription() != null) { + builder.setDescription(oauth2SecurityScheme.getDescription()); + } + if (oauth2SecurityScheme.getFlows() != null) { + builder.setFlows(oauthFlows(oauth2SecurityScheme.getFlows())); + } + return builder.build(); + } + + private static io.a2a.grpc.OAuthFlows oauthFlows(OAuthFlows oAuthFlows) { + io.a2a.grpc.OAuthFlows.Builder builder = io.a2a.grpc.OAuthFlows.newBuilder(); + if (oAuthFlows.authorizationCode() != null) { + builder.setAuthorizationCode(authorizationCodeOAuthFlow(oAuthFlows.authorizationCode())); + } + if (oAuthFlows.clientCredentials() != null) { + builder.setClientCredentials(clientCredentialsOAuthFlow(oAuthFlows.clientCredentials())); + } + if (oAuthFlows.implicit() != null) { + builder.setImplicit(implicitOAuthFlow(oAuthFlows.implicit())); + } + if (oAuthFlows.password() != null) { + builder.setPassword(passwordOAuthFlow(oAuthFlows.password())); + } + return builder.build(); + } + + private static io.a2a.grpc.AuthorizationCodeOAuthFlow authorizationCodeOAuthFlow(AuthorizationCodeOAuthFlow authorizationCodeOAuthFlow) { + io.a2a.grpc.AuthorizationCodeOAuthFlow.Builder builder = io.a2a.grpc.AuthorizationCodeOAuthFlow.newBuilder(); + if (authorizationCodeOAuthFlow.authorizationUrl() != null) { + builder.setAuthorizationUrl(authorizationCodeOAuthFlow.authorizationUrl()); + } + if (authorizationCodeOAuthFlow.refreshUrl() != null) { + builder.setRefreshUrl(authorizationCodeOAuthFlow.refreshUrl()); + } + if (authorizationCodeOAuthFlow.scopes() != null) { + builder.putAllScopes(authorizationCodeOAuthFlow.scopes()); + } + if (authorizationCodeOAuthFlow.tokenUrl() != null) { + builder.setTokenUrl(authorizationCodeOAuthFlow.tokenUrl()); + } + return builder.build(); + } + + private static io.a2a.grpc.ClientCredentialsOAuthFlow clientCredentialsOAuthFlow(ClientCredentialsOAuthFlow clientCredentialsOAuthFlow) { + io.a2a.grpc.ClientCredentialsOAuthFlow.Builder builder = io.a2a.grpc.ClientCredentialsOAuthFlow.newBuilder(); + if (clientCredentialsOAuthFlow.refreshUrl() != null) { + builder.setRefreshUrl(clientCredentialsOAuthFlow.refreshUrl()); + } + if (clientCredentialsOAuthFlow.scopes() != null) { + builder.putAllScopes(clientCredentialsOAuthFlow.scopes()); + } + if (clientCredentialsOAuthFlow.tokenUrl() != null) { + builder.setTokenUrl(clientCredentialsOAuthFlow.tokenUrl()); + } + return builder.build(); + } + + private static io.a2a.grpc.ImplicitOAuthFlow implicitOAuthFlow(ImplicitOAuthFlow implicitOAuthFlow) { + io.a2a.grpc.ImplicitOAuthFlow.Builder builder = io.a2a.grpc.ImplicitOAuthFlow.newBuilder(); + if (implicitOAuthFlow.authorizationUrl() != null) { + builder.setAuthorizationUrl(implicitOAuthFlow.authorizationUrl()); + } + if (implicitOAuthFlow.refreshUrl() != null) { + builder.setRefreshUrl(implicitOAuthFlow.refreshUrl()); + } + if (implicitOAuthFlow.scopes() != null) { + builder.putAllScopes(implicitOAuthFlow.scopes()); + } + return builder.build(); + } + + private static io.a2a.grpc.PasswordOAuthFlow passwordOAuthFlow(PasswordOAuthFlow passwordOAuthFlow) { + io.a2a.grpc.PasswordOAuthFlow.Builder builder = io.a2a.grpc.PasswordOAuthFlow.newBuilder(); + if (passwordOAuthFlow.refreshUrl() != null) { + builder.setRefreshUrl(passwordOAuthFlow.refreshUrl()); + } + if (passwordOAuthFlow.scopes() != null) { + builder.putAllScopes(passwordOAuthFlow.scopes()); + } + if (passwordOAuthFlow.tokenUrl() != null) { + builder.setTokenUrl(passwordOAuthFlow.tokenUrl()); + } + return builder.build(); + } + + private static io.a2a.grpc.OpenIdConnectSecurityScheme openIdConnectSecurityScheme(OpenIdConnectSecurityScheme openIdConnectSecurityScheme) { + io.a2a.grpc.OpenIdConnectSecurityScheme.Builder builder = io.a2a.grpc.OpenIdConnectSecurityScheme.newBuilder(); + if (openIdConnectSecurityScheme.getDescription() != null) { + builder.setDescription(openIdConnectSecurityScheme.getDescription()); + } + if (openIdConnectSecurityScheme.getOpenIdConnectUrl() != null) { + builder.setOpenIdConnectUrl(openIdConnectSecurityScheme.getOpenIdConnectUrl()); + } + return builder.build(); + } + + private static io.a2a.grpc.AgentInterface agentInterface(AgentInterface agentInterface) { + io.a2a.grpc.AgentInterface.Builder builder = io.a2a.grpc.AgentInterface.newBuilder(); + if (agentInterface.transport() != null) { + builder.setTransport(agentInterface.transport()); + } + if (agentInterface.url() != null) { + builder.setUrl(agentInterface.url()); + } + return builder.build(); + } + + public static Struct struct(Map map) { + Struct.Builder structBuilder = Struct.newBuilder(); + if (map != null) { + map.forEach((k, v) -> structBuilder.putFields(k, value(v))); + } + return structBuilder.build(); + } + + private static Value value(Object value) { + Value.Builder valueBuilder = Value.newBuilder(); + if (value instanceof String) { + valueBuilder.setStringValue((String) value); + } else if (value instanceof Number) { + valueBuilder.setNumberValue(((Number) value).doubleValue()); + } else if (value instanceof Boolean) { + valueBuilder.setBoolValue((Boolean) value); + } else if (value instanceof Map) { + valueBuilder.setStructValue(struct((Map) value)); + } else if (value instanceof List) { + valueBuilder.setListValue(listValue((List) value)); + } + return valueBuilder.build(); + } + + private static com.google.protobuf.ListValue listValue(List list) { + com.google.protobuf.ListValue.Builder listValueBuilder = com.google.protobuf.ListValue.newBuilder(); + if (list != null) { + list.forEach(o -> listValueBuilder.addValues(value(o))); + } + return listValueBuilder.build(); + } + + public static StreamResponse streamResponse(StreamingEventKind streamingEventKind) { + if (streamingEventKind instanceof TaskStatusUpdateEvent) { + return StreamResponse.newBuilder() + .setStatusUpdate(taskStatusUpdateEvent((TaskStatusUpdateEvent) streamingEventKind)) + .build(); + } else if (streamingEventKind instanceof TaskArtifactUpdateEvent) { + return StreamResponse.newBuilder() + .setArtifactUpdate(taskArtifactUpdateEvent((TaskArtifactUpdateEvent) streamingEventKind)) + .build(); + } else if (streamingEventKind instanceof Message) { + return StreamResponse.newBuilder() + .setMsg(message((Message) streamingEventKind)) + .build(); + } else if (streamingEventKind instanceof Task) { + return StreamResponse.newBuilder() + .setTask(task((Task) streamingEventKind)) + .build(); + } else { + throw new IllegalArgumentException("Unsupported event type: " + streamingEventKind); + } + } + + public static io.a2a.grpc.SendMessageResponse taskOrMessage(EventKind eventKind) { + if (eventKind instanceof Task) { + return io.a2a.grpc.SendMessageResponse.newBuilder() + .setTask(task((Task) eventKind)) + .build(); + } else if (eventKind instanceof Message) { + return io.a2a.grpc.SendMessageResponse.newBuilder() + .setMsg(message((Message) eventKind)) + .build(); + } else { + throw new IllegalArgumentException("Unsupported event type: " + eventKind); + } + } + + + } + + public static class FromProto { + + public static TaskQueryParams taskQueryParams(io.a2a.grpc.GetTaskRequest request) { + String name = request.getName(); + String id = name.substring(name.lastIndexOf('/') + 1); + return new TaskQueryParams(id, request.getHistoryLength()); + } + + public static TaskIdParams taskIdParams(io.a2a.grpc.CancelTaskRequest request) { + String name = request.getName(); + String id = name.substring(name.lastIndexOf('/') + 1); + return new TaskIdParams(id); + } + + public static MessageSendParams messageSendParams(io.a2a.grpc.SendMessageRequest request) { + MessageSendParams.Builder builder = new MessageSendParams.Builder(); + builder.message(message(request.getRequest())); + if (request.hasConfiguration()) { + builder.configuration(messageSendConfiguration(request.getConfiguration())); + } + if (request.hasMetadata()) { + builder.metadata(struct(request.getMetadata())); + } + return builder.build(); + } + + public static TaskPushNotificationConfig taskPushNotificationConfig(io.a2a.grpc.CreateTaskPushNotificationConfigRequest request) { + return taskPushNotificationConfig(request.getConfig()); + } + + public static TaskPushNotificationConfig taskPushNotificationConfig(io.a2a.grpc.TaskPushNotificationConfig config) { + String name = config.getName(); // "tasks/{id}/pushNotificationConfigs/{push_id}" + String[] parts = name.split("/"); + if (parts.length < 4) { + throw new IllegalArgumentException("Invalid name format for TaskPushNotificationConfig: " + name); + } + String taskId = parts[1]; + String configId = parts[3]; + PushNotificationConfig pnc = pushNotification(config.getPushNotificationConfig(), configId); + return new TaskPushNotificationConfig(taskId, pnc); + } + + public static GetTaskPushNotificationConfigParams getTaskPushNotificationConfigParams(io.a2a.grpc.GetTaskPushNotificationConfigRequest request) { + String name = request.getName(); // "tasks/{id}/pushNotificationConfigs/{push_id}" + String[] parts = name.split("/"); + if (parts.length < 4) { + throw new IllegalArgumentException("Invalid name format for GetTaskPushNotificationConfigRequest: " + name); + } + String taskId = parts[1]; + String configId = parts[3]; + return new GetTaskPushNotificationConfigParams(taskId, configId); + } + + public static TaskIdParams taskIdParams(io.a2a.grpc.TaskSubscriptionRequest request) { + String name = request.getName(); + String id = name.substring(name.lastIndexOf('/') + 1); + return new TaskIdParams(id); + } + + public static ListTaskPushNotificationConfigParams listTaskPushNotificationConfigParams(io.a2a.grpc.ListTaskPushNotificationConfigRequest request) { + String parent = request.getParent(); + String id = parent.substring(parent.lastIndexOf('/') + 1); + return new ListTaskPushNotificationConfigParams(id); + } + + public static DeleteTaskPushNotificationConfigParams deleteTaskPushNotificationConfigParams(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request) { + String name = request.getName(); // "tasks/{id}/pushNotificationConfigs/{push_id}" + String[] parts = name.split("/"); + if (parts.length < 4) { + throw new IllegalArgumentException("Invalid name format for DeleteTaskPushNotificationConfigRequest: " + name); + } + String taskId = parts[1]; + String configId = parts[3]; + return new DeleteTaskPushNotificationConfigParams(taskId, configId); + } + + private static AgentCapabilities agentCapabilities(io.a2a.grpc.AgentCapabilities agentCapabilities) { + return new AgentCapabilities(agentCapabilities.getStreaming(), agentCapabilities.getPushNotifications(), false, + agentCapabilities.getExtensionsList().stream().map(item -> agentExtension(item)).collect(Collectors.toList()) + ); + } + + private static AgentExtension agentExtension(io.a2a.grpc.AgentExtension agentExtension) { + return new AgentExtension( + agentExtension.getDescription(), + struct(agentExtension.getParams()), + agentExtension.getRequired(), + agentExtension.getUri() + ); + } + + private static MessageSendConfiguration messageSendConfiguration(io.a2a.grpc.SendMessageConfiguration sendMessageConfiguration) { + return new MessageSendConfiguration( + new ArrayList<>(sendMessageConfiguration.getAcceptedOutputModesList()), + sendMessageConfiguration.getHistoryLength(), + pushNotification(sendMessageConfiguration.getPushNotification()), + sendMessageConfiguration.getBlocking() + ); + } + + private static PushNotificationConfig pushNotification(io.a2a.grpc.PushNotificationConfig pushNotification, String configId) { + return new PushNotificationConfig( + pushNotification.getUrl(), + pushNotification.getToken(), + authenticationInfo(pushNotification.getAuthentication()), + pushNotification.getId().isEmpty() ? configId : pushNotification.getId() + ); + } + + private static PushNotificationConfig pushNotification(io.a2a.grpc.PushNotificationConfig pushNotification) { + return pushNotification(pushNotification, pushNotification.getId()); + } + + private static PushNotificationAuthenticationInfo authenticationInfo(io.a2a.grpc.AuthenticationInfo authenticationInfo) { + return new PushNotificationAuthenticationInfo( + new ArrayList<>(authenticationInfo.getSchemesList()), + authenticationInfo.getCredentials() + ); + } + + public static Task task(io.a2a.grpc.Task task) { + return new Task( + task.getId(), + task.getContextId(), + taskStatus(task.getStatus()), + task.getArtifactsList().stream().map(item -> artifact(item)).collect(Collectors.toList()), + task.getHistoryList().stream().map(item -> message(item)).collect(Collectors.toList()), + struct(task.getMetadata()) + ); + } + + public static Message message(io.a2a.grpc.Message message) { + return new Message( + role(message.getRole()), + message.getContentList().stream().map(item -> part(item)).collect(Collectors.toList()), + message.getMessageId(), + message.getContextId(), + message.getTaskId(), + null, // referenceTaskIds is not in grpc message + struct(message.getMetadata()) + ); + } + + public static TaskStatusUpdateEvent taskStatusUpdateEvent(io.a2a.grpc.TaskStatusUpdateEvent taskStatusUpdateEvent) { + return new TaskStatusUpdateEvent.Builder() + .taskId(taskStatusUpdateEvent.getTaskId()) + .status(taskStatus(taskStatusUpdateEvent.getStatus())) + .contextId(taskStatusUpdateEvent.getContextId()) + .isFinal(taskStatusUpdateEvent.getFinal()) + .metadata(struct(taskStatusUpdateEvent.getMetadata())) + .build(); + } + + public static TaskArtifactUpdateEvent taskArtifactUpdateEvent(io.a2a.grpc.TaskArtifactUpdateEvent taskArtifactUpdateEvent) { + return new TaskArtifactUpdateEvent.Builder() + .taskId(taskArtifactUpdateEvent.getTaskId()) + .append(taskArtifactUpdateEvent.getAppend()) + .lastChunk(taskArtifactUpdateEvent.getLastChunk()) + .artifact(artifact(taskArtifactUpdateEvent.getArtifact())) + .contextId(taskArtifactUpdateEvent.getContextId()) + .metadata(struct(taskArtifactUpdateEvent.getMetadata())) + .build(); + } + + private static Artifact artifact(io.a2a.grpc.Artifact artifact) { + return new Artifact( + artifact.getArtifactId(), + artifact.getName(), + artifact.getDescription(), + artifact.getPartsList().stream().map(item -> part(item)).collect(Collectors.toList()), + struct(artifact.getMetadata()) + ); + } + + private static Part part(io.a2a.grpc.Part part) { + if (part.hasText()) { + return textPart(part.getText()); + } else if (part.hasFile()) { + return filePart(part.getFile()); + } else if (part.hasData()) { + return dataPart(part.getData()); + } + return null; + } + + private static TextPart textPart(String text) { + return new TextPart(text); + } + + private static FilePart filePart(io.a2a.grpc.FilePart filePart) { + if (filePart.hasFileWithBytes()) { + return new FilePart(new FileWithBytes(filePart.getMimeType(), null, filePart.getFileWithBytes().toStringUtf8())); + } else if (filePart.hasFileWithUri()) { + return new FilePart(new FileWithUri(filePart.getMimeType(), null, filePart.getFileWithUri())); + } + return null; + } + + private static DataPart dataPart(io.a2a.grpc.DataPart dataPart) { + return new DataPart(struct(dataPart.getData())); + } + + private static TaskStatus taskStatus(io.a2a.grpc.TaskStatus taskStatus) { + return new TaskStatus( + taskState(taskStatus.getState()), + message(taskStatus.getUpdate()), + LocalDateTime.ofInstant(Instant.ofEpochSecond(taskStatus.getTimestamp().getSeconds(), taskStatus.getTimestamp().getNanos()), ZoneOffset.UTC) + ); + } + + private static Message.Role role(io.a2a.grpc.Role role) { + if (role == null) { + return null; + } + return switch (role) { + case ROLE_USER -> Message.Role.USER; + case ROLE_AGENT -> Message.Role.AGENT; + default -> null; + }; + } + + private static TaskState taskState(io.a2a.grpc.TaskState taskState) { + if (taskState == null) { + return null; + } + return switch (taskState) { + case TASK_STATE_SUBMITTED -> TaskState.SUBMITTED; + case TASK_STATE_WORKING -> TaskState.WORKING; + case TASK_STATE_INPUT_REQUIRED -> TaskState.INPUT_REQUIRED; + case TASK_STATE_AUTH_REQUIRED -> TaskState.AUTH_REQUIRED; + case TASK_STATE_COMPLETED -> TaskState.COMPLETED; + case TASK_STATE_CANCELLED -> TaskState.CANCELED; + case TASK_STATE_FAILED -> TaskState.FAILED; + case TASK_STATE_REJECTED -> TaskState.REJECTED; + case TASK_STATE_UNSPECIFIED -> null; + case UNRECOGNIZED -> null; + }; + } + + private static Map struct(Struct struct) { + if (struct == null || struct.getFieldsCount() == 0) { + return null; + } + return struct.getFieldsMap().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, e -> value(e.getValue()))); + } + + private static Object value(Value value) { + switch (value.getKindCase()) { + case STRUCT_VALUE: + return struct(value.getStructValue()); + case LIST_VALUE: + return value.getListValue().getValuesList().stream() + .map(FromProto::value) + .collect(Collectors.toList()); + case BOOL_VALUE: + return value.getBoolValue(); + case NUMBER_VALUE: + return value.getNumberValue(); + case STRING_VALUE: + return value.getStringValue(); + case NULL_VALUE: + default: + return null; + } + } + } + + +} \ No newline at end of file diff --git a/grpc/src/main/resources/META-INF/beans.xml b/grpc/src/main/resources/META-INF/beans.xml new file mode 100644 index 000000000..be7990041 --- /dev/null +++ b/grpc/src/main/resources/META-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index e34d09477..95898110e 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,7 @@ + 1.73.0 UTF-8 3.11.0 3.4.2 @@ -51,11 +52,12 @@ 2.0.1 2.1.3 3.1.0 - 5.12.2 + 5.13.4 5.17.0 5.15.0 1.1.1 - 3.22.3 + 4.31.1 + 3.24.5 5.5.1 2.0.17 1.5.18 @@ -69,6 +71,13 @@ + + io.grpc + grpc-bom + ${grpc.version} + pom + import + io.quarkus quarkus-bom @@ -93,6 +102,11 @@ jackson-datatype-jsr310 ${jackson.version} + + com.google.protobuf + protobuf-java + ${protobuf.version} + io.smallrye.reactive mutiny-zero @@ -191,15 +205,6 @@ quarkus-maven-plugin true ${quarkus.platform.version} - - - - build - generate-code - generate-code-tests - - - org.sonatype.central @@ -273,8 +278,10 @@ sdk-server-common common + grpc spec client + reference-grpc reference-impl tck examples/helloworld diff --git a/reference-grpc/pom.xml b/reference-grpc/pom.xml new file mode 100644 index 000000000..d80dae49f --- /dev/null +++ b/reference-grpc/pom.xml @@ -0,0 +1,79 @@ + + + 4.0.0 + + io.github.a2asdk + a2a-java-sdk-parent + 0.2.6.Beta1-SNAPSHOT + ../pom.xml + + + reference-grpc + Java A2A gRPC Reference Server + Java SDK for the Agent2Agent Protocol (A2A) - A2A gRPC Reference Server (based on Quarkus) + + + + ${project.groupId} + a2a-java-sdk-grpc + ${project.version} + + + ${project.groupId} + a2a-java-sdk-server-common + ${project.version} + + + ${project.groupId} + a2a-java-sdk-tests-server-common + ${project.version} + provided + + + ${project.groupId} + a2a-java-sdk-tests-server-common + test-jar + test + ${project.version} + + + + io.quarkus + quarkus-grpc + + + io.quarkus + quarkus-rest + + + io.quarkus + quarkus-junit5 + test + + + org.assertj + assertj-core + 3.25.3 + test + + + com.google.api.grpc + proto-google-common-protos + + + com.google.protobuf + protobuf-java + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + + + + \ No newline at end of file diff --git a/reference-grpc/src/main/java/io/a2a/server/grpc/quarkus/QuarkusGrpcHandler.java b/reference-grpc/src/main/java/io/a2a/server/grpc/quarkus/QuarkusGrpcHandler.java new file mode 100644 index 000000000..05207321b --- /dev/null +++ b/reference-grpc/src/main/java/io/a2a/server/grpc/quarkus/QuarkusGrpcHandler.java @@ -0,0 +1,27 @@ +package io.a2a.server.grpc.quarkus; + +import jakarta.enterprise.inject.Instance; +import jakarta.inject.Inject; + +import io.a2a.grpc.SendMessageRequest; +import io.a2a.grpc.SendMessageResponse; +import io.a2a.grpc.StreamResponse; +import io.a2a.grpc.Task; +import io.a2a.grpc.TaskState; +import io.a2a.grpc.TaskStatus; +import io.a2a.grpc.TaskStatusUpdateEvent; +import io.a2a.server.PublicAgentCard; +import io.a2a.server.requesthandlers.GrpcHandler; +import io.a2a.server.requesthandlers.RequestHandler; +import io.a2a.spec.AgentCard; +import io.grpc.stub.StreamObserver; +import io.quarkus.grpc.GrpcService; + +@GrpcService +public class QuarkusGrpcHandler extends GrpcHandler { + + @Inject + public QuarkusGrpcHandler(@PublicAgentCard AgentCard agentCard, RequestHandler requestHandler) { + super(agentCard, requestHandler); + } +} \ No newline at end of file diff --git a/reference-grpc/src/main/resources/application.properties b/reference-grpc/src/main/resources/application.properties new file mode 100644 index 000000000..f8286bd6f --- /dev/null +++ b/reference-grpc/src/main/resources/application.properties @@ -0,0 +1,5 @@ +quarkus.grpc.clients.a2-a-service.host=localhost +quarkus.grpc.clients.a2-a-service.port=9001 + +# The GrpcHandler @ApplicationScoped annotation is not compatible with Quarkus +quarkus.arc.exclude-types=io.a2a.server.requesthandlers.GrpcHandler \ No newline at end of file diff --git a/reference-grpc/src/test/java/io/a2a/server/grpc/quarkus/A2ATestResource.java b/reference-grpc/src/test/java/io/a2a/server/grpc/quarkus/A2ATestResource.java new file mode 100644 index 000000000..917606e42 --- /dev/null +++ b/reference-grpc/src/test/java/io/a2a/server/grpc/quarkus/A2ATestResource.java @@ -0,0 +1,132 @@ +package io.a2a.server.grpc.quarkus; + +import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN; + +import java.util.concurrent.atomic.AtomicInteger; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; + +import io.a2a.server.apps.common.TestUtilsBean; +import io.a2a.server.requesthandlers.GrpcHandler; +import io.a2a.spec.PushNotificationConfig; +import io.a2a.spec.Task; +import io.a2a.spec.TaskArtifactUpdateEvent; +import io.a2a.spec.TaskStatusUpdateEvent; +import io.a2a.util.Utils; + +@Path("/test") +@ApplicationScoped +public class A2ATestResource { + @Inject + TestUtilsBean testUtilsBean; + + private final AtomicInteger streamingSubscribedCount = new AtomicInteger(0); + + @PostConstruct + public void init() { + GrpcHandler.setStreamingSubscribedRunnable(streamingSubscribedCount::incrementAndGet); + } + + + @POST + @Path("/task") + @Consumes(MediaType.APPLICATION_JSON) + public Response saveTask(String body) throws Exception { + Task task = Utils.OBJECT_MAPPER.readValue(body, Task.class); + testUtilsBean.saveTask(task); + return Response.ok().build(); + } + + @GET + @Path("/task/{taskId}") + public Response getTask(@PathParam("taskId") String taskId) throws Exception { + Task task = testUtilsBean.getTask(taskId); + if (task == null) { + return Response.status(404).build(); + } + return Response.ok() + .entity(Utils.OBJECT_MAPPER.writeValueAsString(task)) + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } + + @DELETE + @Path("/task/{taskId}") + public Response deleteTask(@PathParam("taskId") String taskId) { + Task task = testUtilsBean.getTask(taskId); + if (task == null) { + return Response.status(404).build(); + } + testUtilsBean.deleteTask(taskId); + return Response.ok() + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } + + @POST + @Path("/queue/ensure/{taskId}") + public Response ensureQueue(@PathParam("taskId") String taskId) { + testUtilsBean.ensureQueue(taskId); + return Response.ok().build(); + } + + @POST + @Path("/queue/enqueueTaskStatusUpdateEvent/{taskId}") + public Response enqueueTaskStatusUpdateEvent(@PathParam("taskId") String taskId, String body) throws Exception { + TaskStatusUpdateEvent event = Utils.OBJECT_MAPPER.readValue(body, TaskStatusUpdateEvent.class); + testUtilsBean.enqueueEvent(taskId, event); + return Response.ok().build(); + } + + @POST + @Path("/queue/enqueueTaskArtifactUpdateEvent/{taskId}") + public Response enqueueTaskArtifactUpdateEvent(@PathParam("taskId") String taskId, String body) throws Exception { + TaskArtifactUpdateEvent event = Utils.OBJECT_MAPPER.readValue(body, TaskArtifactUpdateEvent.class); + testUtilsBean.enqueueEvent(taskId, event); + return Response.ok().build(); + } + + @GET + @Path("/streamingSubscribedCount") + @Produces(TEXT_PLAIN) + public Response getStreamingSubscribedCount() { + return Response.ok(String.valueOf(streamingSubscribedCount.get()), TEXT_PLAIN).build(); + } + + @DELETE + @Path("/task/{taskId}/config/{configId}") + public Response deleteTaskPushNotificationConfig(@PathParam("taskId") String taskId, @PathParam("configId") String configId) { + Task task = testUtilsBean.getTask(taskId); + if (task == null) { + return Response.status(404).build(); + } + testUtilsBean.deleteTaskPushNotificationConfig(taskId, configId); + return Response.ok() + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .build(); + } + + @POST + @Path("/task/{taskId}") + @Consumes(MediaType.APPLICATION_JSON) + public Response savePushNotificationConfigInStore(@PathParam("taskId") String taskId, String body) throws Exception { + PushNotificationConfig notificationConfig = Utils.OBJECT_MAPPER.readValue(body, PushNotificationConfig.class); + if (notificationConfig == null) { + return Response.status(404).build(); + } + testUtilsBean.saveTaskPushNotificationConfig(taskId, notificationConfig); + return Response.ok().build(); + } +} diff --git a/reference-grpc/src/test/java/io/a2a/server/grpc/quarkus/QuarkusA2AGrpcTest.java b/reference-grpc/src/test/java/io/a2a/server/grpc/quarkus/QuarkusA2AGrpcTest.java new file mode 100644 index 000000000..076d9a29b --- /dev/null +++ b/reference-grpc/src/test/java/io/a2a/server/grpc/quarkus/QuarkusA2AGrpcTest.java @@ -0,0 +1,1245 @@ +package io.a2a.server.grpc.quarkus; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +import io.a2a.grpc.A2AServiceGrpc; +import io.a2a.grpc.CancelTaskRequest; +import io.a2a.grpc.CreateTaskPushNotificationConfigRequest; +import io.a2a.grpc.DeleteTaskPushNotificationConfigRequest; +import io.a2a.grpc.GetTaskPushNotificationConfigRequest; +import io.a2a.grpc.GetTaskRequest; +import io.a2a.grpc.ListTaskPushNotificationConfigRequest; +import io.a2a.grpc.ListTaskPushNotificationConfigResponse; +import io.a2a.grpc.SendMessageRequest; +import io.a2a.grpc.SendMessageResponse; +import io.a2a.grpc.StreamResponse; +import io.a2a.grpc.TaskSubscriptionRequest; +import io.a2a.grpc.utils.ProtoUtils; +import io.a2a.grpc.GetAgentCardRequest; +import io.a2a.spec.AgentCard; +import io.a2a.spec.Artifact; +import io.a2a.spec.Event; +import io.a2a.spec.Message; +import io.a2a.spec.Part; +import io.a2a.spec.PushNotificationConfig; +import io.a2a.spec.Task; +import io.a2a.spec.TaskPushNotificationConfig; +import io.a2a.spec.TaskArtifactUpdateEvent; +import io.a2a.spec.TaskState; +import io.a2a.spec.TaskStatus; +import io.a2a.spec.TaskStatusUpdateEvent; +import io.a2a.spec.TextPart; +import io.a2a.util.Utils; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.quarkus.grpc.GrpcClient; +import io.quarkus.test.junit.QuarkusTest; +import org.junit.jupiter.api.Test; + +@QuarkusTest +public class QuarkusA2AGrpcTest { + + + private static final Task MINIMAL_TASK = new Task.Builder() + .id("task-123") + .contextId("session-xyz") + .status(new TaskStatus(TaskState.SUBMITTED)) + .build(); + + private static final Task CANCEL_TASK = new Task.Builder() + .id("cancel-task-123") + .contextId("session-xyz") + .status(new TaskStatus(TaskState.SUBMITTED)) + .build(); + + private static final Task CANCEL_TASK_NOT_SUPPORTED = new Task.Builder() + .id("cancel-task-not-supported-123") + .contextId("session-xyz") + .status(new TaskStatus(TaskState.SUBMITTED)) + .build(); + + private static final Task SEND_MESSAGE_NOT_SUPPORTED = new Task.Builder() + .id("task-not-supported-123") + .contextId("session-xyz") + .status(new TaskStatus(TaskState.SUBMITTED)) + .build(); + + private static final Message MESSAGE = new Message.Builder() + .messageId("111") + .role(Message.Role.AGENT) + .parts(new TextPart("test message")) + .build(); + public static final String APPLICATION_JSON = "application/json"; + + @GrpcClient("a2-a-service") + A2AServiceGrpc.A2AServiceBlockingStub client; + + private final int serverPort = 8081; + @Test + public void testTaskStoreMethodsSanityTest() throws Exception { + Task task = new Task.Builder(MINIMAL_TASK).id("abcde").build(); + saveTaskInTaskStore(task); + Task saved = getTaskFromTaskStore(task.getId()); + assertEquals(task.getId(), saved.getId()); + assertEquals(task.getContextId(), saved.getContextId()); + assertEquals(task.getStatus().state(), saved.getStatus().state()); + + deleteTaskInTaskStore(task.getId()); + Task saved2 = getTaskFromTaskStore(task.getId()); + assertNull(saved2); + } + + @Test + public void testGetTaskSuccess() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + GetTaskRequest request = GetTaskRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + io.a2a.grpc.Task response = client.getTask(request); + assertEquals("task-123", response.getId()); + assertEquals("session-xyz", response.getContextId()); + assertEquals(io.a2a.grpc.TaskState.TASK_STATE_SUBMITTED, response.getStatus().getState()); + } finally { + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testGetTaskNotFound() throws Exception { + assertTrue(getTaskFromTaskStore("non-existent-task") == null); + GetTaskRequest request = GetTaskRequest.newBuilder() + .setName("tasks/non-existent-task") + .build(); + try { + client.getTask(request); + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + assertEquals(Status.NOT_FOUND.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("TaskNotFoundError")); + } + } + + @Test + public void testCancelTaskSuccess() throws Exception { + saveTaskInTaskStore(CANCEL_TASK); + try { + CancelTaskRequest request = CancelTaskRequest.newBuilder() + .setName("tasks/" + CANCEL_TASK.getId()) + .build(); + io.a2a.grpc.Task response = client.cancelTask(request); + assertEquals(CANCEL_TASK.getId(), response.getId()); + assertEquals(CANCEL_TASK.getContextId(), response.getContextId()); + assertEquals(io.a2a.grpc.TaskState.TASK_STATE_CANCELLED, response.getStatus().getState()); + } finally { + deleteTaskInTaskStore(CANCEL_TASK.getId()); + } + } + + @Test + public void testCancelTaskNotFound() throws Exception { + CancelTaskRequest request = CancelTaskRequest.newBuilder() + .setName("tasks/non-existent-task") + .build(); + try { + client.cancelTask(request); + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + assertEquals(Status.NOT_FOUND.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("TaskNotFoundError")); + } + } + + @Test + public void testCancelTaskNotSupported() throws Exception { + saveTaskInTaskStore(CANCEL_TASK_NOT_SUPPORTED); + try { + CancelTaskRequest request = CancelTaskRequest.newBuilder() + .setName("tasks/" + CANCEL_TASK_NOT_SUPPORTED.getId()) + .build(); + try { + client.cancelTask(request); + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + assertEquals(Status.UNIMPLEMENTED.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("UnsupportedOperationError")); + } + } finally { + deleteTaskInTaskStore(CANCEL_TASK_NOT_SUPPORTED.getId()); + } + } + + @Test + public void testSendMessageNewMessageSuccess() throws Exception { + assertTrue(getTaskFromTaskStore(MINIMAL_TASK.getId()) == null); + Message message = new Message.Builder(MESSAGE) + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .build(); + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(ProtoUtils.ToProto.message(message)) + .build(); + SendMessageResponse response = client.sendMessage(request); + assertTrue(response.hasMsg()); + io.a2a.grpc.Message grpcMessage = response.getMsg(); + // Convert back to spec Message for easier assertions + Message messageResponse = ProtoUtils.FromProto.message(grpcMessage); + assertEquals(MESSAGE.getMessageId(), messageResponse.getMessageId()); + assertEquals(MESSAGE.getRole(), messageResponse.getRole()); + Part part = messageResponse.getParts().get(0); + assertEquals(Part.Kind.TEXT, part.getKind()); + assertEquals("test message", ((TextPart) part).getText()); + } + + @Test + public void testSendMessageExistingTaskSuccess() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + Message message = new Message.Builder(MESSAGE) + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .build(); + + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(ProtoUtils.ToProto.message(message)) + .build(); + SendMessageResponse response = client.sendMessage(request); + + assertTrue(response.hasMsg()); + io.a2a.grpc.Message grpcMessage = response.getMsg(); + // Convert back to spec Message for easier assertions + Message messageResponse = ProtoUtils.FromProto.message(grpcMessage); + assertEquals(MESSAGE.getMessageId(), messageResponse.getMessageId()); + assertEquals(MESSAGE.getRole(), messageResponse.getRole()); + Part part = messageResponse.getParts().get(0); + assertEquals(Part.Kind.TEXT, part.getKind()); + assertEquals("test message", ((TextPart) part).getText()); + } finally { + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testError() throws Exception { + Message message = new Message.Builder(MESSAGE) + .taskId(SEND_MESSAGE_NOT_SUPPORTED.getId()) + .contextId(SEND_MESSAGE_NOT_SUPPORTED.getContextId()) + .build(); + + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(ProtoUtils.ToProto.message(message)) + .build(); + + try { + client.sendMessage(request); + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + assertEquals(Status.UNIMPLEMENTED.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("UnsupportedOperationError")); + } + } + + @Test + public void testGetAgentCard() throws Exception { + // Test gRPC getAgentCard method + GetAgentCardRequest request = GetAgentCardRequest.newBuilder().build(); + + io.a2a.grpc.AgentCard grpcAgentCard = client.getAgentCard(request); + + // Verify the expected agent card fields directly on the gRPC response + assertNotNull(grpcAgentCard); + assertEquals("test-card", grpcAgentCard.getName()); + assertEquals("A test agent card", grpcAgentCard.getDescription()); + assertEquals("http://localhost:" + serverPort, grpcAgentCard.getUrl()); // Use dynamic port + assertEquals("1.0", grpcAgentCard.getVersion()); + assertEquals("http://example.com/docs", grpcAgentCard.getDocumentationUrl()); + assertTrue(grpcAgentCard.getCapabilities().getPushNotifications()); + assertTrue(grpcAgentCard.getCapabilities().getStreaming()); + // Note: stateTransitionHistory is not present in gRPC AgentCapabilities + assertTrue(grpcAgentCard.getSkillsList().isEmpty()); + } + + @Test + public void testGetExtendAgentCardNotSupported() { + // NOTE: This test is not applicable to gRPC since extended agent card retrieval + // is an HTTP/REST-specific feature that tests the /agent/authenticatedExtendedCard endpoint. + // gRPC handles agent capabilities differently through service definitions. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testMalformedJSONRPCRequest() { + // NOTE: This test is not applicable to gRPC since it tests JSON-RPC protocol-specific + // JSON parsing errors. gRPC uses Protocol Buffers for serialization and has its own + // parsing and validation mechanisms. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testInvalidParamsJSONRPCRequest() { + // NOTE: This test is not applicable to gRPC since it tests JSON-RPC protocol-specific + // parameter validation errors. gRPC uses strongly-typed Protocol Buffer messages + // which provide built-in type safety and validation. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testInvalidJSONRPCRequestMissingJsonrpc() { + // NOTE: This test is not applicable to gRPC since it tests JSON-RPC protocol-specific + // validation of the "jsonrpc" field. gRPC does not use JSON-RPC protocol elements. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testInvalidJSONRPCRequestMissingMethod() { + // NOTE: This test is not applicable to gRPC since it tests JSON-RPC protocol-specific + // validation of the "method" field. gRPC methods are defined in the service definition + // and invoked directly, not through JSON-RPC method names. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testInvalidJSONRPCRequestInvalidId() { + // NOTE: This test is not applicable to gRPC since it tests JSON-RPC protocol-specific + // validation of the "id" field. gRPC handles request/response correlation differently + // through its streaming mechanisms. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testInvalidJSONRPCRequestNonExistentMethod() { + // NOTE: This test is not applicable to gRPC since it tests JSON-RPC protocol-specific + // method not found errors. gRPC method resolution is handled at the service definition + // level and unknown methods result in different error types. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testNonStreamingMethodWithAcceptHeader() throws Exception { + // NOTE: This test is not applicable to gRPC since HTTP Accept headers + // are an HTTP/REST-specific concept and do not apply to gRPC protocol. + // gRPC uses Protocol Buffers for message encoding and doesn't use HTTP content negotiation. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testSetPushNotificationSuccess() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // Create a PushNotificationConfig with an ID (needed for gRPC conversion) + PushNotificationConfig pushConfig = new PushNotificationConfig.Builder() + .url("http://example.com") + .id(MINIMAL_TASK.getId()) // Using task ID as config ID for simplicity + .build(); + TaskPushNotificationConfig taskPushConfig = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig); + + CreateTaskPushNotificationConfigRequest request = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId(MINIMAL_TASK.getId()) + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig)) + .build(); + + io.a2a.grpc.TaskPushNotificationConfig response = client.createTaskPushNotificationConfig(request); + + // Convert back to spec for easier assertions + TaskPushNotificationConfig responseConfig = ProtoUtils.FromProto.taskPushNotificationConfig(response); + assertEquals(MINIMAL_TASK.getId(), responseConfig.taskId()); + assertEquals("http://example.com", responseConfig.pushNotificationConfig().url()); + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), MINIMAL_TASK.getId()); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testGetPushNotificationSuccess() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // First, create a push notification config (same as previous test) + PushNotificationConfig pushConfig = new PushNotificationConfig.Builder() + .url("http://example.com") + .id(MINIMAL_TASK.getId()) + .build(); + TaskPushNotificationConfig taskPushConfig = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig); + + CreateTaskPushNotificationConfigRequest createRequest = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId(MINIMAL_TASK.getId()) + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig)) + .build(); + + io.a2a.grpc.TaskPushNotificationConfig createResponse = client.createTaskPushNotificationConfig(createRequest); + assertNotNull(createResponse); + + // Now, get the push notification config + GetTaskPushNotificationConfigRequest getRequest = GetTaskPushNotificationConfigRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId()) + .build(); + + io.a2a.grpc.TaskPushNotificationConfig getResponse = client.getTaskPushNotificationConfig(getRequest); + + // Convert back to spec for easier assertions + TaskPushNotificationConfig responseConfig = ProtoUtils.FromProto.taskPushNotificationConfig(getResponse); + assertEquals(MINIMAL_TASK.getId(), responseConfig.taskId()); + assertEquals("http://example.com", responseConfig.pushNotificationConfig().url()); + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), MINIMAL_TASK.getId()); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testListPushNotificationConfigWithConfigId() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // Create first push notification config + PushNotificationConfig pushConfig1 = new PushNotificationConfig.Builder() + .url("http://example.com") + .id("config1") + .build(); + TaskPushNotificationConfig taskPushConfig1 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig1); + + CreateTaskPushNotificationConfigRequest createRequest1 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId("config1") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig1)) + .build(); + client.createTaskPushNotificationConfig(createRequest1); + + // Create second push notification config + PushNotificationConfig pushConfig2 = new PushNotificationConfig.Builder() + .url("http://example.com") + .id("config2") + .build(); + TaskPushNotificationConfig taskPushConfig2 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig2); + + CreateTaskPushNotificationConfigRequest createRequest2 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId("config2") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig2)) + .build(); + client.createTaskPushNotificationConfig(createRequest2); + + // Now, list all push notification configs for the task + ListTaskPushNotificationConfigRequest listRequest = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + + ListTaskPushNotificationConfigResponse listResponse = client.listTaskPushNotificationConfig(listRequest); + + // Verify the response + assertEquals(2, listResponse.getConfigsCount()); + + // Convert back to spec for easier assertions + TaskPushNotificationConfig config1 = ProtoUtils.FromProto.taskPushNotificationConfig(listResponse.getConfigs(0)); + TaskPushNotificationConfig config2 = ProtoUtils.FromProto.taskPushNotificationConfig(listResponse.getConfigs(1)); + + assertEquals(MINIMAL_TASK.getId(), config1.taskId()); + assertEquals("http://example.com", config1.pushNotificationConfig().url()); + assertEquals("config1", config1.pushNotificationConfig().id()); + + assertEquals(MINIMAL_TASK.getId(), config2.taskId()); + assertEquals("http://example.com", config2.pushNotificationConfig().url()); + assertEquals("config2", config2.pushNotificationConfig().id()); + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), "config1"); + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), "config2"); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testListPushNotificationConfigWithoutConfigId() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // Create first push notification config without explicit ID (will use task ID as default) + PushNotificationConfig pushConfig1 = new PushNotificationConfig.Builder() + .url("http://1.example.com") + .id(MINIMAL_TASK.getId()) // Use task ID as config ID + .build(); + TaskPushNotificationConfig taskPushConfig1 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig1); + + CreateTaskPushNotificationConfigRequest createRequest1 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId(MINIMAL_TASK.getId()) + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig1)) + .build(); + client.createTaskPushNotificationConfig(createRequest1); + + // Create second push notification config with same ID (will overwrite the previous one) + PushNotificationConfig pushConfig2 = new PushNotificationConfig.Builder() + .url("http://2.example.com") + .id(MINIMAL_TASK.getId()) // Same ID, will overwrite + .build(); + TaskPushNotificationConfig taskPushConfig2 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig2); + + CreateTaskPushNotificationConfigRequest createRequest2 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId(MINIMAL_TASK.getId()) + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig2)) + .build(); + client.createTaskPushNotificationConfig(createRequest2); + + // Now, list all push notification configs for the task + ListTaskPushNotificationConfigRequest listRequest = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + + ListTaskPushNotificationConfigResponse listResponse = client.listTaskPushNotificationConfig(listRequest); + + // Verify only 1 config exists (second one overwrote the first) + assertEquals(1, listResponse.getConfigsCount()); + + // Convert back to spec for easier assertions + TaskPushNotificationConfig config = ProtoUtils.FromProto.taskPushNotificationConfig(listResponse.getConfigs(0)); + + assertEquals(MINIMAL_TASK.getId(), config.taskId()); + assertEquals("http://2.example.com", config.pushNotificationConfig().url()); + assertEquals(MINIMAL_TASK.getId(), config.pushNotificationConfig().id()); + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), MINIMAL_TASK.getId()); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testListPushNotificationConfigTaskNotFound() throws Exception { + ListTaskPushNotificationConfigRequest listRequest = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/non-existent-task") + .build(); + + try { + client.listTaskPushNotificationConfig(listRequest); + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + assertEquals(Status.NOT_FOUND.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("TaskNotFoundError")); + } + } + + @Test + public void testListPushNotificationConfigEmptyList() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // List configs for a task that has no configs + ListTaskPushNotificationConfigRequest listRequest = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + + ListTaskPushNotificationConfigResponse listResponse = client.listTaskPushNotificationConfig(listRequest); + + // Verify empty list + assertEquals(0, listResponse.getConfigsCount()); + } finally { + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testDeletePushNotificationConfigWithValidConfigId() throws Exception { + // Create a second task for testing cross-task isolation + Task secondTask = new Task.Builder() + .id("task-456") + .contextId("session-xyz") + .status(new TaskStatus(TaskState.SUBMITTED)) + .build(); + + saveTaskInTaskStore(MINIMAL_TASK); + saveTaskInTaskStore(secondTask); + try { + // Create config1 and config2 for MINIMAL_TASK + PushNotificationConfig pushConfig1 = new PushNotificationConfig.Builder() + .url("http://example.com") + .id("config1") + .build(); + TaskPushNotificationConfig taskPushConfig1 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig1); + + CreateTaskPushNotificationConfigRequest createRequest1 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId("config1") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig1)) + .build(); + client.createTaskPushNotificationConfig(createRequest1); + + PushNotificationConfig pushConfig2 = new PushNotificationConfig.Builder() + .url("http://example.com") + .id("config2") + .build(); + TaskPushNotificationConfig taskPushConfig2 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig2); + + CreateTaskPushNotificationConfigRequest createRequest2 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId("config2") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig2)) + .build(); + client.createTaskPushNotificationConfig(createRequest2); + + // Create config1 for secondTask + TaskPushNotificationConfig taskPushConfig3 = + new TaskPushNotificationConfig(secondTask.getId(), pushConfig1); + + CreateTaskPushNotificationConfigRequest createRequest3 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + secondTask.getId()) + .setConfigId("config1") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig3)) + .build(); + client.createTaskPushNotificationConfig(createRequest3); + + // Delete config1 from MINIMAL_TASK + DeleteTaskPushNotificationConfigRequest deleteRequest = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/config1") + .build(); + + com.google.protobuf.Empty deleteResponse = client.deleteTaskPushNotificationConfig(deleteRequest); + assertNotNull(deleteResponse); // Should return Empty, not null + + // Verify MINIMAL_TASK now has only 1 config (config2) + ListTaskPushNotificationConfigRequest listRequest1 = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + ListTaskPushNotificationConfigResponse listResponse1 = client.listTaskPushNotificationConfig(listRequest1); + assertEquals(1, listResponse1.getConfigsCount()); + + TaskPushNotificationConfig remainingConfig = ProtoUtils.FromProto.taskPushNotificationConfig(listResponse1.getConfigs(0)); + assertEquals("config2", remainingConfig.pushNotificationConfig().id()); + + // Verify secondTask remains unchanged (still has config1) + ListTaskPushNotificationConfigRequest listRequest2 = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + secondTask.getId()) + .build(); + ListTaskPushNotificationConfigResponse listResponse2 = client.listTaskPushNotificationConfig(listRequest2); + assertEquals(1, listResponse2.getConfigsCount()); + + TaskPushNotificationConfig secondTaskConfig = ProtoUtils.FromProto.taskPushNotificationConfig(listResponse2.getConfigs(0)); + assertEquals("config1", secondTaskConfig.pushNotificationConfig().id()); + + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), "config1"); + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), "config2"); + deletePushNotificationConfigInStore(secondTask.getId(), "config1"); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + deleteTaskInTaskStore(secondTask.getId()); + } + } + + @Test + public void testDeletePushNotificationConfigWithNonExistingConfigId() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // Create config1 and config2 + PushNotificationConfig pushConfig1 = new PushNotificationConfig.Builder() + .url("http://example.com") + .id("config1") + .build(); + TaskPushNotificationConfig taskPushConfig1 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig1); + + CreateTaskPushNotificationConfigRequest createRequest1 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId("config1") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig1)) + .build(); + client.createTaskPushNotificationConfig(createRequest1); + + PushNotificationConfig pushConfig2 = new PushNotificationConfig.Builder() + .url("http://example.com") + .id("config2") + .build(); + TaskPushNotificationConfig taskPushConfig2 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig2); + + CreateTaskPushNotificationConfigRequest createRequest2 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId("config2") + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig2)) + .build(); + client.createTaskPushNotificationConfig(createRequest2); + + // Try to delete non-existent config (should succeed silently) + DeleteTaskPushNotificationConfigRequest deleteRequest = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/non-existent-config-id") + .build(); + + com.google.protobuf.Empty deleteResponse = client.deleteTaskPushNotificationConfig(deleteRequest); + assertNotNull(deleteResponse); // Should return Empty, not throw error + + // Verify both configs remain unchanged + ListTaskPushNotificationConfigRequest listRequest = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + ListTaskPushNotificationConfigResponse listResponse = client.listTaskPushNotificationConfig(listRequest); + assertEquals(2, listResponse.getConfigsCount()); + + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), "config1"); + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), "config2"); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testDeletePushNotificationConfigTaskNotFound() throws Exception { + DeleteTaskPushNotificationConfigRequest deleteRequest = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName("tasks/non-existent-task/pushNotificationConfigs/non-existent-config-id") + .build(); + + try { + client.deleteTaskPushNotificationConfig(deleteRequest); + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + assertEquals(Status.NOT_FOUND.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("TaskNotFoundError")); + } + } + + @Test + public void testDeletePushNotificationConfigSetWithoutConfigId() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // Create first config without explicit ID (will use task ID as default) + PushNotificationConfig pushConfig1 = new PushNotificationConfig.Builder() + .url("http://1.example.com") + .id(MINIMAL_TASK.getId()) + .build(); + TaskPushNotificationConfig taskPushConfig1 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig1); + + CreateTaskPushNotificationConfigRequest createRequest1 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId(MINIMAL_TASK.getId()) + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig1)) + .build(); + client.createTaskPushNotificationConfig(createRequest1); + + // Create second config with same ID (will overwrite the previous one) + PushNotificationConfig pushConfig2 = new PushNotificationConfig.Builder() + .url("http://2.example.com") + .id(MINIMAL_TASK.getId()) + .build(); + TaskPushNotificationConfig taskPushConfig2 = + new TaskPushNotificationConfig(MINIMAL_TASK.getId(), pushConfig2); + + CreateTaskPushNotificationConfigRequest createRequest2 = CreateTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .setConfigId(MINIMAL_TASK.getId()) + .setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(taskPushConfig2)) + .build(); + client.createTaskPushNotificationConfig(createRequest2); + + // Delete the config using task ID + DeleteTaskPushNotificationConfigRequest deleteRequest = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId()) + .build(); + + com.google.protobuf.Empty deleteResponse = client.deleteTaskPushNotificationConfig(deleteRequest); + assertNotNull(deleteResponse); // Should return Empty + + // Verify no configs remain + ListTaskPushNotificationConfigRequest listRequest = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + ListTaskPushNotificationConfigResponse listResponse = client.listTaskPushNotificationConfig(listRequest); + assertEquals(0, listResponse.getConfigsCount()); + + } finally { + deletePushNotificationConfigInStore(MINIMAL_TASK.getId(), MINIMAL_TASK.getId()); + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testSendMessageStreamExistingTaskSuccess() throws Exception { + saveTaskInTaskStore(MINIMAL_TASK); + try { + // Build message for existing task + Message message = new Message.Builder(MESSAGE) + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .build(); + + // Create gRPC streaming request + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(ProtoUtils.ToProto.message(message)) + .build(); + + // Use blocking iterator to consume stream responses + java.util.Iterator responseIterator = client.sendStreamingMessage(request); + + // Collect responses - expect at least one + java.util.List responses = new java.util.ArrayList<>(); + while (responseIterator.hasNext()) { + StreamResponse response = responseIterator.next(); + responses.add(response); + + // For this test, we expect to get the message back - stop after first response + if (response.hasMsg()) { + break; + } + } + + // Verify we got at least one response + assertTrue(responses.size() >= 1, "Expected at least one response from streaming call"); + + // Find the message response + StreamResponse messageResponse = null; + for (StreamResponse response : responses) { + if (response.hasMsg()) { + messageResponse = response; + break; + } + } + + assertNotNull(messageResponse, "Expected to receive a message response"); + + // Verify the message content + io.a2a.grpc.Message grpcMessage = messageResponse.getMsg(); + Message responseMessage = ProtoUtils.FromProto.message(grpcMessage); + assertEquals(MESSAGE.getMessageId(), responseMessage.getMessageId()); + assertEquals(MESSAGE.getRole(), responseMessage.getRole()); + Part part = responseMessage.getParts().get(0); + assertEquals(Part.Kind.TEXT, part.getKind()); + assertEquals("test message", ((TextPart) part).getText()); + + } finally { + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } + } + + @Test + public void testStreamingMethodWithAcceptHeader() throws Exception { + // NOTE: This test is not applicable to gRPC since HTTP Accept headers + // are an HTTP/REST-specific concept and do not apply to gRPC protocol. + // gRPC uses Protocol Buffers for message encoding and doesn't use HTTP content negotiation. + + // This stub is maintained to preserve method order compatibility with AbstractA2AServerTest + // for future migration when extending that base class. + } + + @Test + public void testSendMessageStreamNewMessageSuccess() throws Exception { + // Ensure no task exists initially (test creates new task via streaming) + assertTrue(getTaskFromTaskStore(MINIMAL_TASK.getId()) == null, "Task should not exist initially"); + + try { + // Build message for new task (no pre-existing task) + Message message = new Message.Builder(MESSAGE) + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .build(); + + // Create gRPC streaming request + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(ProtoUtils.ToProto.message(message)) + .build(); + + // Use blocking iterator to consume stream responses + java.util.Iterator responseIterator = client.sendStreamingMessage(request); + + // Collect responses - expect at least one + java.util.List responses = new java.util.ArrayList<>(); + while (responseIterator.hasNext()) { + StreamResponse response = responseIterator.next(); + responses.add(response); + + // For this test, we expect to get the message back - stop after first response + if (response.hasMsg()) { + break; + } + } + + // Verify we got at least one response + assertTrue(responses.size() >= 1, "Expected at least one response from streaming call"); + + // Find the message response + StreamResponse messageResponse = null; + for (StreamResponse response : responses) { + if (response.hasMsg()) { + messageResponse = response; + break; + } + } + + assertNotNull(messageResponse, "Expected to receive a message response"); + + // Verify the message content + io.a2a.grpc.Message grpcMessage = messageResponse.getMsg(); + Message responseMessage = ProtoUtils.FromProto.message(grpcMessage); + assertEquals(MESSAGE.getMessageId(), responseMessage.getMessageId()); + assertEquals(MESSAGE.getRole(), responseMessage.getRole()); + Part part = responseMessage.getParts().get(0); + assertEquals(Part.Kind.TEXT, part.getKind()); + assertEquals("test message", ((TextPart) part).getText()); + + } finally { + // Clean up any task that may have been created (ignore if task doesn't exist) + try { + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + } catch (RuntimeException e) { + // Ignore if task doesn't exist (404 error) + if (!e.getMessage().contains("404")) { + throw e; + } + } + } + } + + @Test + public void testResubscribeExistingTaskSuccess() throws Exception { + ExecutorService executorService = Executors.newSingleThreadExecutor(); + saveTaskInTaskStore(MINIMAL_TASK); + + try { + // Ensure queue for task exists (required for resubscription) + ensureQueueForTask(MINIMAL_TASK.getId()); + + CountDownLatch taskResubscriptionRequestSent = new CountDownLatch(1); + CountDownLatch taskResubscriptionResponseReceived = new CountDownLatch(2); + AtomicReference firstResponse = new AtomicReference<>(); + AtomicReference secondResponse = new AtomicReference<>(); + + // Create gRPC task subscription request + TaskSubscriptionRequest subscriptionRequest = TaskSubscriptionRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + + // Count down the latch when the gRPC streaming subscription is established + awaitStreamingSubscription() + .whenComplete((unused, throwable) -> taskResubscriptionRequestSent.countDown()); + + AtomicReference errorRef = new AtomicReference<>(); + + // Start the subscription in a separate thread + executorService.submit(() -> { + try { + java.util.Iterator responseIterator = client.taskSubscription(subscriptionRequest); + + while (responseIterator.hasNext()) { + StreamResponse response = responseIterator.next(); + + if (taskResubscriptionResponseReceived.getCount() == 2) { + firstResponse.set(response); + } else { + secondResponse.set(response); + } + taskResubscriptionResponseReceived.countDown(); + + if (taskResubscriptionResponseReceived.getCount() == 0) { + break; + } + } + } catch (Exception e) { + errorRef.set(e); + // Count down both latches to unblock the test + taskResubscriptionRequestSent.countDown(); + while (taskResubscriptionResponseReceived.getCount() > 0) { + taskResubscriptionResponseReceived.countDown(); + } + } + }); + + // Wait for subscription to be established + assertTrue(taskResubscriptionRequestSent.await(10, TimeUnit.SECONDS), "Subscription should be established"); + + // Inject events into the server's event queue + java.util.List events = java.util.List.of( + new TaskArtifactUpdateEvent.Builder() + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .artifact(new Artifact.Builder() + .artifactId("11") + .parts(new TextPart("text")) + .build()) + .build(), + new TaskStatusUpdateEvent.Builder() + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .status(new TaskStatus(TaskState.COMPLETED)) + .isFinal(true) + .build()); + + for (Event event : events) { + enqueueEventOnServer(event); + } + + // Wait for the client to receive the responses + assertTrue(taskResubscriptionResponseReceived.await(20, TimeUnit.SECONDS), "Should receive both responses"); + + // Check for errors + if (errorRef.get() != null) { + throw new RuntimeException("Error in subscription thread", errorRef.get()); + } + + // Verify first response (TaskArtifactUpdateEvent) + assertNotNull(firstResponse.get(), "Should receive first response"); + StreamResponse firstStreamResponse = firstResponse.get(); + assertTrue(firstStreamResponse.hasArtifactUpdate(), "First response should be artifact update"); + + io.a2a.grpc.TaskArtifactUpdateEvent artifactUpdate = firstStreamResponse.getArtifactUpdate(); + assertEquals(MINIMAL_TASK.getId(), artifactUpdate.getTaskId()); + assertEquals(MINIMAL_TASK.getContextId(), artifactUpdate.getContextId()); + assertEquals("11", artifactUpdate.getArtifact().getArtifactId()); + assertEquals("text", artifactUpdate.getArtifact().getParts(0).getText()); + + // Verify second response (TaskStatusUpdateEvent) + assertNotNull(secondResponse.get(), "Should receive second response"); + StreamResponse secondStreamResponse = secondResponse.get(); + assertTrue(secondStreamResponse.hasStatusUpdate(), "Second response should be status update"); + + io.a2a.grpc.TaskStatusUpdateEvent statusUpdate = secondStreamResponse.getStatusUpdate(); + assertEquals(MINIMAL_TASK.getId(), statusUpdate.getTaskId()); + assertEquals(MINIMAL_TASK.getContextId(), statusUpdate.getContextId()); + assertEquals(io.a2a.grpc.TaskState.TASK_STATE_COMPLETED, statusUpdate.getStatus().getState()); + assertTrue(statusUpdate.getFinal(), "Final status update should be marked as final"); + + } finally { + deleteTaskInTaskStore(MINIMAL_TASK.getId()); + executorService.shutdown(); + if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) { + executorService.shutdownNow(); + } + } + } + + @Test + public void testResubscribeNoExistingTaskError() throws Exception { + // Try to resubscribe to a non-existent task - should get TaskNotFoundError + TaskSubscriptionRequest request = TaskSubscriptionRequest.newBuilder() + .setName("tasks/non-existent-task") + .build(); + + try { + // Use blocking iterator to consume stream responses + java.util.Iterator responseIterator = client.taskSubscription(request); + + // Try to get first response - should throw StatusRuntimeException + if (responseIterator.hasNext()) { + responseIterator.next(); + } + + // Should not reach here + assertTrue(false, "Expected StatusRuntimeException but method returned normally"); + } catch (StatusRuntimeException e) { + // Verify this is a TaskNotFoundError mapped to NOT_FOUND status + assertEquals(Status.NOT_FOUND.getCode(), e.getStatus().getCode()); + String description = e.getStatus().getDescription(); + assertTrue(description != null && description.contains("TaskNotFoundError")); + } + } + + + protected void saveTaskInTaskStore(Task task) throws Exception { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("http://localhost:" + serverPort + "/test/task")) + .POST(HttpRequest.BodyPublishers.ofString(Utils.OBJECT_MAPPER.writeValueAsString(task))) + .header("Content-Type", APPLICATION_JSON) + .build(); + + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new RuntimeException( + String.format("Saving task failed! Status: %d, Body: %s", response.statusCode(), response.body())); + } + } + + protected Task getTaskFromTaskStore(String taskId) throws Exception { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("http://localhost:" + serverPort + "/test/task/" + taskId)) + .GET() + .build(); + + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() == 404) { + return null; + } + if (response.statusCode() != 200) { + throw new RuntimeException(String.format("Getting task failed! Status: %d, Body: %s", response.statusCode(), response.body())); + } + return Utils.OBJECT_MAPPER.readValue(response.body(), Task.TYPE_REFERENCE); + } + + protected void deleteTaskInTaskStore(String taskId) throws Exception { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create(("http://localhost:" + serverPort + "/test/task/" + taskId))) + .DELETE() + .build(); + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new RuntimeException(response.statusCode() + ": Deleting task failed!" + response.body()); + } + } + + protected void ensureQueueForTask(String taskId) throws Exception { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("http://localhost:" + serverPort + "/test/queue/ensure/" + taskId)) + .POST(HttpRequest.BodyPublishers.noBody()) + .build(); + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new RuntimeException(String.format("Ensuring queue failed! Status: %d, Body: %s", response.statusCode(), response.body())); + } + } + + protected void enqueueEventOnServer(Event event) throws Exception { + String path; + if (event instanceof TaskArtifactUpdateEvent e) { + path = "test/queue/enqueueTaskArtifactUpdateEvent/" + e.getTaskId(); + } else if (event instanceof TaskStatusUpdateEvent e) { + path = "test/queue/enqueueTaskStatusUpdateEvent/" + e.getTaskId(); + } else { + throw new RuntimeException("Unknown event type " + event.getClass() + ". If you need the ability to" + + " handle more types, please add the REST endpoints."); + } + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("http://localhost:" + serverPort + "/" + path)) + .header("Content-Type", APPLICATION_JSON) + .POST(HttpRequest.BodyPublishers.ofString(Utils.OBJECT_MAPPER.writeValueAsString(event))) + .build(); + + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new RuntimeException(response.statusCode() + ": Queueing event failed!" + response.body()); + } + } + + private CompletableFuture awaitStreamingSubscription() { + int cnt = getStreamingSubscribedCount(); + AtomicInteger initialCount = new AtomicInteger(cnt); + + return CompletableFuture.runAsync(() -> { + try { + boolean done = false; + long end = System.currentTimeMillis() + 15000; + while (System.currentTimeMillis() < end) { + int count = getStreamingSubscribedCount(); + if (count > initialCount.get()) { + done = true; + break; + } + Thread.sleep(500); + } + if (!done) { + throw new RuntimeException("Timed out waiting for subscription"); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("Interrupted"); + } + }); + } + + private int getStreamingSubscribedCount() { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("http://localhost:" + serverPort + "/test/streamingSubscribedCount")) + .GET() + .build(); + try { + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + String body = response.body().trim(); + return Integer.parseInt(body); + } catch (IOException | InterruptedException e) { + throw new RuntimeException(e); + } + } + + protected void deletePushNotificationConfigInStore(String taskId, String configId) throws Exception { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create(("http://localhost:" + serverPort + "/test/task/" + taskId + "/config/" + configId))) + .DELETE() + .build(); + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new RuntimeException(response.statusCode() + ": Deleting task failed!" + response.body()); + } + } + + protected void savePushNotificationConfigInStore(String taskId, PushNotificationConfig notificationConfig) throws Exception { + HttpClient client = HttpClient.newBuilder() + .version(HttpClient.Version.HTTP_2) + .build(); + HttpRequest request = HttpRequest.newBuilder() + .uri(URI.create("http://localhost:" + serverPort + "/test/task/" + taskId)) + .POST(HttpRequest.BodyPublishers.ofString(Utils.OBJECT_MAPPER.writeValueAsString(notificationConfig))) + .header("Content-Type", APPLICATION_JSON) + .build(); + + HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new RuntimeException(response.statusCode() + ": Creating task push notification config failed! " + response.body()); + } + } + +} diff --git a/sdk-server-common/pom.xml b/sdk-server-common/pom.xml index 8fc372323..a0ed10cca 100644 --- a/sdk-server-common/pom.xml +++ b/sdk-server-common/pom.xml @@ -27,6 +27,11 @@ a2a-java-sdk-client ${project.version} + + ${project.groupId} + a2a-java-sdk-grpc + ${project.version} + com.fasterxml.jackson.core jackson-databind @@ -94,6 +99,11 @@ logback-classic test + + io.grpc + grpc-testing + test + \ No newline at end of file diff --git a/sdk-server-common/src/main/java/io/a2a/server/requesthandlers/CallContextFactory.java b/sdk-server-common/src/main/java/io/a2a/server/requesthandlers/CallContextFactory.java new file mode 100644 index 000000000..ef173ba0d --- /dev/null +++ b/sdk-server-common/src/main/java/io/a2a/server/requesthandlers/CallContextFactory.java @@ -0,0 +1,8 @@ +package io.a2a.server.requesthandlers; + +import io.a2a.server.ServerCallContext; +import io.grpc.stub.StreamObserver; + +public interface CallContextFactory { + ServerCallContext create(StreamObserver responseObserver); +} diff --git a/sdk-server-common/src/main/java/io/a2a/server/requesthandlers/GrpcHandler.java b/sdk-server-common/src/main/java/io/a2a/server/requesthandlers/GrpcHandler.java new file mode 100644 index 000000000..e514feae7 --- /dev/null +++ b/sdk-server-common/src/main/java/io/a2a/server/requesthandlers/GrpcHandler.java @@ -0,0 +1,394 @@ +package io.a2a.server.requesthandlers; + +import static io.a2a.grpc.utils.ProtoUtils.FromProto; +import static io.a2a.grpc.utils.ProtoUtils.ToProto; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Instance; +import jakarta.inject.Inject; + +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Flow; + +import com.google.protobuf.Empty; +import io.a2a.grpc.A2AServiceGrpc; +import io.a2a.grpc.StreamResponse; +import io.a2a.server.PublicAgentCard; +import io.a2a.server.ServerCallContext; +import io.a2a.server.auth.UnauthenticatedUser; +import io.a2a.server.auth.User; +import io.a2a.spec.AgentCard; +import io.a2a.spec.ContentTypeNotSupportedError; +import io.a2a.spec.DeleteTaskPushNotificationConfigParams; +import io.a2a.spec.EventKind; +import io.a2a.spec.GetTaskPushNotificationConfigParams; +import io.a2a.spec.InternalError; +import io.a2a.spec.InvalidAgentResponseError; +import io.a2a.spec.InvalidParamsError; +import io.a2a.spec.InvalidRequestError; +import io.a2a.spec.JSONParseError; +import io.a2a.spec.JSONRPCError; +import io.a2a.spec.ListTaskPushNotificationConfigParams; +import io.a2a.spec.MessageSendParams; +import io.a2a.spec.MethodNotFoundError; +import io.a2a.spec.PushNotificationNotSupportedError; +import io.a2a.spec.StreamingEventKind; +import io.a2a.spec.Task; +import io.a2a.spec.TaskIdParams; +import io.a2a.spec.TaskNotCancelableError; +import io.a2a.spec.TaskNotFoundError; +import io.a2a.spec.TaskPushNotificationConfig; +import io.a2a.spec.TaskQueryParams; +import io.a2a.spec.UnsupportedOperationError; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; + +import java.util.HashMap; +import java.util.Map; + +@ApplicationScoped +public class GrpcHandler extends A2AServiceGrpc.A2AServiceImplBase { + + private AgentCard agentCard; + private RequestHandler requestHandler; + + // Hook so testing can wait until streaming subscriptions are established. + // Without this we get intermittent failures + private static volatile Runnable streamingSubscribedRunnable; + + @Inject + Instance callContextFactory; + + protected GrpcHandler() { + } + + @Inject + public GrpcHandler(@PublicAgentCard AgentCard agentCard, RequestHandler requestHandler) { + this.agentCard = agentCard; + this.requestHandler = requestHandler; + } + + @Override + public void sendMessage(io.a2a.grpc.SendMessageRequest request, + StreamObserver responseObserver) { + try { + ServerCallContext context = createCallContext(responseObserver); + MessageSendParams params = FromProto.messageSendParams(request); + EventKind taskOrMessage = requestHandler.onMessageSend(params, context); + io.a2a.grpc.SendMessageResponse response = ToProto.taskOrMessage(taskOrMessage); + responseObserver.onNext(response); + responseObserver.onCompleted(); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void getTask(io.a2a.grpc.GetTaskRequest request, + StreamObserver responseObserver) { + try { + ServerCallContext context = createCallContext(responseObserver); + TaskQueryParams params = FromProto.taskQueryParams(request); + Task task = requestHandler.onGetTask(params, context); + if (task != null) { + responseObserver.onNext(ToProto.task(task)); + responseObserver.onCompleted(); + } else { + handleError(responseObserver, new TaskNotFoundError()); + } + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void cancelTask(io.a2a.grpc.CancelTaskRequest request, + StreamObserver responseObserver) { + try { + ServerCallContext context = createCallContext(responseObserver); + TaskIdParams params = FromProto.taskIdParams(request); + Task task = requestHandler.onCancelTask(params, context); + if (task != null) { + responseObserver.onNext(ToProto.task(task)); + responseObserver.onCompleted(); + } else { + handleError(responseObserver, new TaskNotFoundError()); + } + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void createTaskPushNotificationConfig(io.a2a.grpc.CreateTaskPushNotificationConfigRequest request, + StreamObserver responseObserver) { + if (! agentCard.capabilities().pushNotifications()) { + handleError(responseObserver, new PushNotificationNotSupportedError()); + return; + } + + try { + ServerCallContext context = createCallContext(responseObserver); + TaskPushNotificationConfig config = FromProto.taskPushNotificationConfig(request); + TaskPushNotificationConfig responseConfig = requestHandler.onSetTaskPushNotificationConfig(config, context); + responseObserver.onNext(ToProto.taskPushNotificationConfig(responseConfig)); + responseObserver.onCompleted(); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void getTaskPushNotificationConfig(io.a2a.grpc.GetTaskPushNotificationConfigRequest request, + StreamObserver responseObserver) { + if (! agentCard.capabilities().pushNotifications()) { + handleError(responseObserver, new PushNotificationNotSupportedError()); + return; + } + + try { + ServerCallContext context = createCallContext(responseObserver); + GetTaskPushNotificationConfigParams params = FromProto.getTaskPushNotificationConfigParams(request); + TaskPushNotificationConfig config = requestHandler.onGetTaskPushNotificationConfig(params, context); + responseObserver.onNext(ToProto.taskPushNotificationConfig(config)); + responseObserver.onCompleted(); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void listTaskPushNotificationConfig(io.a2a.grpc.ListTaskPushNotificationConfigRequest request, + StreamObserver responseObserver) { + if (! agentCard.capabilities().pushNotifications()) { + handleError(responseObserver, new PushNotificationNotSupportedError()); + return; + } + + try { + ServerCallContext context = createCallContext(responseObserver); + ListTaskPushNotificationConfigParams params = FromProto.listTaskPushNotificationConfigParams(request); + List configList = requestHandler.onListTaskPushNotificationConfig(params, context); + io.a2a.grpc.ListTaskPushNotificationConfigResponse.Builder responseBuilder = + io.a2a.grpc.ListTaskPushNotificationConfigResponse.newBuilder(); + for (TaskPushNotificationConfig config : configList) { + responseBuilder.addConfigs(ToProto.taskPushNotificationConfig(config)); + } + responseObserver.onNext(responseBuilder.build()); + responseObserver.onCompleted(); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void sendStreamingMessage(io.a2a.grpc.SendMessageRequest request, + StreamObserver responseObserver) { + if (! agentCard.capabilities().streaming()) { + handleError(responseObserver, new InvalidRequestError()); + return; + } + + try { + ServerCallContext context = createCallContext(responseObserver); + MessageSendParams params = FromProto.messageSendParams(request); + Flow.Publisher publisher = requestHandler.onMessageSendStream(params, context); + convertToStreamResponse(publisher, responseObserver); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void taskSubscription(io.a2a.grpc.TaskSubscriptionRequest request, + StreamObserver responseObserver) { + if (! agentCard.capabilities().streaming()) { + handleError(responseObserver, new InvalidRequestError()); + return; + } + + try { + ServerCallContext context = createCallContext(responseObserver); + TaskIdParams params = FromProto.taskIdParams(request); + Flow.Publisher publisher = requestHandler.onResubscribeToTask(params, context); + convertToStreamResponse(publisher, responseObserver); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + private void convertToStreamResponse(Flow.Publisher publisher, + StreamObserver responseObserver) { + CompletableFuture.runAsync(() -> { + publisher.subscribe(new Flow.Subscriber() { + private Flow.Subscription subscription; + + @Override + public void onSubscribe(Flow.Subscription subscription) { + this.subscription = subscription; + subscription.request(1); + + // Notify tests that we are subscribed + Runnable runnable = streamingSubscribedRunnable; + if (runnable != null) { + runnable.run(); + } + } + + @Override + public void onNext(StreamingEventKind event) { + StreamResponse response = ToProto.streamResponse(event); + responseObserver.onNext(response); + if (response.hasStatusUpdate() && response.getStatusUpdate().getFinal()) { + responseObserver.onCompleted(); + } else { + subscription.request(1); + } + } + + @Override + public void onError(Throwable throwable) { + if (throwable instanceof JSONRPCError jsonrpcError) { + handleError(responseObserver, jsonrpcError); + } else { + handleInternalError(responseObserver, throwable); + } + responseObserver.onCompleted(); + } + + @Override + public void onComplete() { + responseObserver.onCompleted(); + } + }); + }); + } + + @Override + public void getAgentCard(io.a2a.grpc.GetAgentCardRequest request, + StreamObserver responseObserver) { + try { + responseObserver.onNext(ToProto.agentCard(agentCard)); + responseObserver.onCompleted(); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + @Override + public void deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotificationConfigRequest request, + StreamObserver responseObserver) { + if (! agentCard.capabilities().pushNotifications()) { + handleError(responseObserver, new PushNotificationNotSupportedError()); + return; + } + + try { + ServerCallContext context = createCallContext(responseObserver); + DeleteTaskPushNotificationConfigParams params = FromProto.deleteTaskPushNotificationConfigParams(request); + requestHandler.onDeleteTaskPushNotificationConfig(params, context); + // void response + responseObserver.onNext(Empty.getDefaultInstance()); + responseObserver.onCompleted(); + } catch (JSONRPCError e) { + handleError(responseObserver, e); + } catch (Throwable t) { + handleInternalError(responseObserver, t); + } + } + + private ServerCallContext createCallContext(StreamObserver responseObserver) { + if (callContextFactory == null || callContextFactory.isUnsatisfied()) { + // Default implementation when no custom CallContextFactory is provided + // This handles both CDI injection scenarios and test scenarios where callContextFactory is null + User user = UnauthenticatedUser.INSTANCE; + Map state = new HashMap<>(); + + // TODO: ARCHITECTURAL LIMITATION - StreamObserver is NOT equivalent to Python's grpc.aio.ServicerContext + // In Python: context parameter provides metadata, peer info, cancellation, etc. + // In Java: the proper equivalent would be ServerCall + Metadata from ServerInterceptor + // Current compromise: Store StreamObserver for basic functionality, but it lacks rich context + // + // FUTURE ENHANCEMENT: Implement ServerInterceptor to capture ServerCall + Metadata, + // store in gRPC Context using Context.Key, then access via Context.current().get(key) + // This would provide proper equivalence to Python's ServicerContext + state.put("grpc_response_observer", responseObserver); + + return new ServerCallContext(user, state); + } else { + CallContextFactory factory = callContextFactory.get(); + // TODO: CallContextFactory interface expects ServerCall + Metadata, but we only have StreamObserver + // This is another manifestation of the architectural limitation mentioned above + return factory.create(responseObserver); // Fall back to basic create() method for now + } + } + + private void handleError(StreamObserver responseObserver, JSONRPCError error) { + Status status; + String description; + if (error instanceof InvalidRequestError) { + status = Status.INVALID_ARGUMENT; + description = "InvalidRequestError: " + error.getMessage(); + } else if (error instanceof MethodNotFoundError) { + status = Status.NOT_FOUND; + description = "MethodNotFoundError: " + error.getMessage(); + } else if (error instanceof InvalidParamsError) { + status = Status.INVALID_ARGUMENT; + description = "InvalidParamsError: " + error.getMessage(); + } else if (error instanceof InternalError) { + status = Status.INTERNAL; + description = "InternalError: " + error.getMessage(); + } else if (error instanceof TaskNotFoundError) { + status = Status.NOT_FOUND; + description = "TaskNotFoundError: " + error.getMessage(); + } else if (error instanceof TaskNotCancelableError) { + status = Status.UNIMPLEMENTED; + description = "TaskNotCancelableError: " + error.getMessage(); + } else if (error instanceof PushNotificationNotSupportedError) { + status = Status.UNIMPLEMENTED; + description = "PushNotificationNotSupportedError: " + error.getMessage(); + } else if (error instanceof UnsupportedOperationError) { + status = Status.UNIMPLEMENTED; + description = "UnsupportedOperationError: " + error.getMessage(); + } else if (error instanceof JSONParseError) { + status = Status.INTERNAL; + description = "JSONParseError: " + error.getMessage(); + } else if (error instanceof ContentTypeNotSupportedError) { + status = Status.UNIMPLEMENTED; + description = "ContentTypeNotSupportedError: " + error.getMessage(); + } else if (error instanceof InvalidAgentResponseError) { + status = Status.INTERNAL; + description = "InvalidAgentResponseError: " + error.getMessage(); + } else { + status = Status.UNKNOWN; + description = "Unknown error type: " + error.getMessage(); + } + responseObserver.onError(status.withDescription(description).asRuntimeException()); + } + + private void handleInternalError(StreamObserver responseObserver, Throwable t) { + handleError(responseObserver, new InternalError(t.getMessage())); + } + + public static void setStreamingSubscribedRunnable(Runnable runnable) { + streamingSubscribedRunnable = runnable; + } + +} diff --git a/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/AbstractA2ARequestHandlerTest.java b/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/AbstractA2ARequestHandlerTest.java new file mode 100644 index 000000000..a8cf3fcf0 --- /dev/null +++ b/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/AbstractA2ARequestHandlerTest.java @@ -0,0 +1,188 @@ +package io.a2a.server.requesthandlers; + +import jakarta.enterprise.context.Dependent; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.function.Consumer; + +import io.a2a.http.A2AHttpClient; +import io.a2a.http.A2AHttpResponse; +import io.a2a.server.agentexecution.AgentExecutor; +import io.a2a.server.agentexecution.RequestContext; +import io.a2a.server.events.EventQueue; +import io.a2a.server.events.InMemoryQueueManager; +import io.a2a.server.tasks.BasePushNotificationSender; +import io.a2a.server.tasks.InMemoryPushNotificationConfigStore; +import io.a2a.server.tasks.InMemoryTaskStore; +import io.a2a.server.tasks.PushNotificationConfigStore; +import io.a2a.server.tasks.PushNotificationSender; +import io.a2a.server.tasks.TaskStore; +import io.a2a.spec.AgentCapabilities; +import io.a2a.spec.AgentCard; +import io.a2a.spec.JSONRPCError; +import io.a2a.spec.Message; +import io.a2a.spec.Task; +import io.a2a.spec.TaskState; +import io.a2a.spec.TaskStatus; +import io.a2a.spec.TextPart; +import io.a2a.util.Utils; +import io.quarkus.arc.profile.IfBuildProfile; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; + +public class AbstractA2ARequestHandlerTest { + + protected static final AgentCard CARD = createAgentCard(true, true, true); + + protected static final Task MINIMAL_TASK = new Task.Builder() + .id("task-123") + .contextId("session-xyz") + .status(new TaskStatus(TaskState.SUBMITTED)) + .build(); + + protected static final Message MESSAGE = new Message.Builder() + .messageId("111") + .role(Message.Role.AGENT) + .parts(new TextPart("test message")) + .build(); + + AgentExecutor executor; + TaskStore taskStore; + RequestHandler requestHandler; + AgentExecutorMethod agentExecutorExecute; + AgentExecutorMethod agentExecutorCancel; + InMemoryQueueManager queueManager; + TestHttpClient httpClient; + + final Executor internalExecutor = Executors.newCachedThreadPool(); + + @BeforeEach + public void init() { + executor = new AgentExecutor() { + @Override + public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError { + if (agentExecutorExecute != null) { + agentExecutorExecute.invoke(context, eventQueue); + } + } + + @Override + public void cancel(RequestContext context, EventQueue eventQueue) throws JSONRPCError { + if (agentExecutorCancel != null) { + agentExecutorCancel.invoke(context, eventQueue); + } + } + }; + + taskStore = new InMemoryTaskStore(); + queueManager = new InMemoryQueueManager(); + httpClient = new TestHttpClient(); + PushNotificationConfigStore pushConfigStore = new InMemoryPushNotificationConfigStore(); + PushNotificationSender pushSender = new BasePushNotificationSender(pushConfigStore, httpClient); + + requestHandler = new DefaultRequestHandler(executor, taskStore, queueManager, pushConfigStore, pushSender, internalExecutor); + } + + @AfterEach + public void cleanup() { + agentExecutorExecute = null; + agentExecutorCancel = null; + } + + protected static AgentCard createAgentCard(boolean streaming, boolean pushNotifications, boolean stateTransitionHistory) { + return new AgentCard.Builder() + .name("test-card") + .description("A test agent card") + .url("http://example.com") + .version("1.0") + .documentationUrl("http://example.com/docs") + .capabilities(new AgentCapabilities.Builder() + .streaming(streaming) + .pushNotifications(pushNotifications) + .stateTransitionHistory(stateTransitionHistory) + .build()) + .defaultInputModes(new ArrayList<>()) + .defaultOutputModes(new ArrayList<>()) + .skills(new ArrayList<>()) + .protocolVersion("0.2.5") + .build(); + } + + protected interface AgentExecutorMethod { + void invoke(RequestContext context, EventQueue eventQueue) throws JSONRPCError; + } + + @Dependent + @IfBuildProfile("test") + protected static class TestHttpClient implements A2AHttpClient { + final List tasks = Collections.synchronizedList(new ArrayList<>()); + volatile CountDownLatch latch; + + @Override + public GetBuilder createGet() { + return null; + } + + @Override + public PostBuilder createPost() { + return new TestHttpClient.TestPostBuilder(); + } + + class TestPostBuilder implements A2AHttpClient.PostBuilder { + private volatile String body; + @Override + public PostBuilder body(String body) { + this.body = body; + return this; + } + + @Override + public A2AHttpResponse post() throws IOException, InterruptedException { + tasks.add(Utils.OBJECT_MAPPER.readValue(body, Task.TYPE_REFERENCE)); + try { + return new A2AHttpResponse() { + @Override + public int status() { + return 200; + } + + @Override + public boolean success() { + return true; + } + + @Override + public String body() { + return ""; + } + }; + } finally { + latch.countDown(); + } + } + + @Override + public CompletableFuture postAsyncSSE(Consumer messageConsumer, Consumer errorConsumer, Runnable completeRunnable) throws IOException, InterruptedException { + return null; + } + + @Override + public PostBuilder url(String s) { + return this; + } + + @Override + public PostBuilder addHeader(String name, String value) { + return this; + } + } + } +} diff --git a/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/GrpcHandlerTest.java b/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/GrpcHandlerTest.java new file mode 100644 index 000000000..87a1a9bc8 --- /dev/null +++ b/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/GrpcHandlerTest.java @@ -0,0 +1,806 @@ +package io.a2a.server.requesthandlers; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import com.google.protobuf.Empty; +import com.google.protobuf.Struct; + +import io.a2a.grpc.AuthenticationInfo; +import io.a2a.grpc.CancelTaskRequest; +import io.a2a.grpc.CreateTaskPushNotificationConfigRequest; +import io.a2a.grpc.DeleteTaskPushNotificationConfigRequest; +import io.a2a.grpc.GetTaskPushNotificationConfigRequest; +import io.a2a.grpc.GetTaskRequest; +import io.a2a.grpc.ListTaskPushNotificationConfigRequest; +import io.a2a.grpc.ListTaskPushNotificationConfigResponse; +import io.a2a.grpc.Message; +import io.a2a.grpc.Part; +import io.a2a.grpc.PushNotificationConfig; +import io.a2a.grpc.Role; +import io.a2a.grpc.SendMessageRequest; +import io.a2a.grpc.SendMessageResponse; +import io.a2a.grpc.StreamResponse; +import io.a2a.grpc.Task; +import io.a2a.grpc.TaskPushNotificationConfig; +import io.a2a.grpc.TaskState; +import io.a2a.grpc.TaskStatus; +import io.a2a.grpc.TaskSubscriptionRequest; +import io.a2a.server.ServerCallContext; +import io.a2a.server.events.EventConsumer; +import io.a2a.server.tasks.TaskUpdater; +import io.a2a.spec.AgentCard; +import io.a2a.spec.Artifact; +import io.a2a.spec.Event; +import io.a2a.spec.InternalError; +import io.a2a.spec.MessageSendParams; +import io.a2a.spec.TaskArtifactUpdateEvent; +import io.a2a.spec.TaskStatusUpdateEvent; +import io.a2a.spec.TextPart; +import io.a2a.spec.UnsupportedOperationError; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.internal.testing.StreamRecorder; +import io.grpc.stub.StreamObserver; +import mutiny.zero.ZeroPublisher; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.MockedConstruction; +import org.mockito.Mockito; + +public class GrpcHandlerTest extends AbstractA2ARequestHandlerTest { + + private static final Message GRPC_MESSAGE = Message.newBuilder() + .setTaskId(MINIMAL_TASK.getId()) + .setContextId(MINIMAL_TASK.getContextId()) + .setMessageId(MESSAGE.getMessageId()) + .setRole(Role.ROLE_AGENT) + .addContent(Part.newBuilder().setText(((TextPart)MESSAGE.getParts().get(0)).getText()).build()) + .setMetadata(Struct.newBuilder().build()) + .build(); + + + @Test + public void testOnGetTaskSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + GetTaskRequest request = GetTaskRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.getTask(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + Task task = result.get(0); + assertEquals(MINIMAL_TASK.getId(), task.getId()); + assertEquals(MINIMAL_TASK.getContextId(), task.getContextId()); + assertEquals(TaskState.TASK_STATE_SUBMITTED, task.getStatus().getState()); + } + + @Test + public void testOnGetTaskNotFound() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + GetTaskRequest request = GetTaskRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.getTask(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + + assertGrpcError(streamRecorder, Status.Code.NOT_FOUND); + } + + @Test + public void testOnCancelTaskSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + + agentExecutorCancel = (context, eventQueue) -> { + // We need to cancel the task or the EventConsumer never finds a 'final' event. + // Looking at the Python implementation, they typically use AgentExecutors that + // don't support cancellation. So my theory is the Agent updates the task to the CANCEL status + io.a2a.spec.Task task = context.getTask(); + TaskUpdater taskUpdater = new TaskUpdater(context, eventQueue); + taskUpdater.cancel(); + }; + + CancelTaskRequest request = CancelTaskRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.cancelTask(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + Task task = result.get(0); + assertEquals(MINIMAL_TASK.getId(), task.getId()); + assertEquals(MINIMAL_TASK.getContextId(), task.getContextId()); + assertEquals(TaskState.TASK_STATE_CANCELLED, task.getStatus().getState()); + } + + @Test + public void testOnCancelTaskNotSupported() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + + agentExecutorCancel = (context, eventQueue) -> { + throw new UnsupportedOperationError(); + }; + + CancelTaskRequest request = CancelTaskRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.cancelTask(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testOnCancelTaskNotFound() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + CancelTaskRequest request = CancelTaskRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.cancelTask(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + + assertGrpcError(streamRecorder, Status.Code.NOT_FOUND); + } + + @Test + public void testOnMessageNewMessageSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getMessage()); + }; + + StreamRecorder streamRecorder = sendMessageRequest(handler); + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + SendMessageResponse response = result.get(0); + assertEquals(GRPC_MESSAGE, response.getMsg()); + } + + @Test + public void testOnMessageNewMessageWithExistingTaskSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getMessage()); + }; + StreamRecorder streamRecorder = sendMessageRequest(handler); + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + SendMessageResponse response = result.get(0); + assertEquals(GRPC_MESSAGE, response.getMsg()); + } + + @Test + public void testOnMessageError() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(new UnsupportedOperationError()); + }; + StreamRecorder streamRecorder = sendMessageRequest(handler); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testSetPushNotificationConfigSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + "config456"; + StreamRecorder streamRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + TaskPushNotificationConfig response = result.get(0); + assertEquals(NAME, response.getName()); + PushNotificationConfig responseConfig = response.getPushNotificationConfig(); + assertEquals("config456", responseConfig.getId()); + assertEquals("http://example.com", responseConfig.getUrl()); + assertEquals(AuthenticationInfo.getDefaultInstance(), responseConfig.getAuthentication()); + assertTrue(responseConfig.getToken().isEmpty()); + } + + @Test + public void testGetPushNotificationConfigSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + "config456"; + + // first set the task push notification config + StreamRecorder streamRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + assertNull(streamRecorder.getError()); + + // then get the task push notification config + streamRecorder = getTaskPushNotificationConfigRequest(handler, NAME); + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + TaskPushNotificationConfig response = result.get(0); + assertEquals(NAME, response.getName()); + PushNotificationConfig responseConfig = response.getPushNotificationConfig(); + assertEquals("config456", responseConfig.getId()); + assertEquals("http://example.com", responseConfig.getUrl()); + assertEquals(AuthenticationInfo.getDefaultInstance(), responseConfig.getAuthentication()); + assertTrue(responseConfig.getToken().isEmpty()); + } + + @Test + public void testPushNotificationsNotSupportedError() throws Exception { + AgentCard card = createAgentCard(true, false, true); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + StreamRecorder streamRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testOnGetPushNotificationNoPushNotifierConfig() throws Exception { + // Create request handler without a push notifier + DefaultRequestHandler requestHandler = + new DefaultRequestHandler(executor, taskStore, queueManager, null, null, internalExecutor); + AgentCard card = createAgentCard(false, true, false); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + StreamRecorder streamRecorder = getTaskPushNotificationConfigRequest(handler, NAME); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testOnSetPushNotificationNoPushNotifierConfig() throws Exception { + // Create request handler without a push notifier + DefaultRequestHandler requestHandler = + new DefaultRequestHandler(executor, taskStore, queueManager, null, null, internalExecutor); + AgentCard card = createAgentCard(false, true, false); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + StreamRecorder streamRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testOnMessageStreamNewMessageSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + StreamRecorder streamRecorder = sendStreamingMessageRequest(handler); + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + StreamResponse response = result.get(0); + assertTrue(response.hasMsg()); + Message message = response.getMsg(); + assertEquals(GRPC_MESSAGE, message); + } + + @Test + public void testOnMessageStreamNewMessageExistingTaskSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + io.a2a.spec.Task task = new io.a2a.spec.Task.Builder(MINIMAL_TASK) + .history(new ArrayList<>()) + .build(); + taskStore.save(task); + + List results = new ArrayList<>(); + List errors = new ArrayList<>(); + final CountDownLatch latch = new CountDownLatch(1); + httpClient.latch = latch; + StreamObserver streamObserver = new StreamObserver<>() { + @Override + public void onNext(StreamResponse streamResponse) { + results.add(streamResponse); + latch.countDown(); + } + + @Override + public void onError(Throwable throwable) { + errors.add(throwable); + } + + @Override + public void onCompleted() { + } + }; + sendStreamingMessageRequest(handler, streamObserver); + Assertions.assertTrue(latch.await(1, TimeUnit.SECONDS)); + assertTrue(errors.isEmpty()); + assertEquals(1, results.size()); + StreamResponse response = results.get(0); + assertTrue(response.hasTask()); + Task taskResponse = response.getTask(); + + Task expected = Task.newBuilder() + .setId(MINIMAL_TASK.getId()) + .setContextId(MINIMAL_TASK.getContextId()) + .addAllHistory(List.of(GRPC_MESSAGE)) + .setStatus(TaskStatus.newBuilder().setStateValue(TaskState.TASK_STATE_SUBMITTED_VALUE)) + .build(); + assertEquals(expected.getId(), taskResponse.getId()); + assertEquals(expected.getContextId(), taskResponse.getContextId()); + assertEquals(expected.getStatus().getState(), taskResponse.getStatus().getState()); + assertEquals(expected.getHistoryList(), taskResponse.getHistoryList()); + } + + @Test + public void testOnMessageStreamNewMessageExistingTaskSuccessMocks() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + + io.a2a.spec.Task task = new io.a2a.spec.Task.Builder(MINIMAL_TASK) + .history(new ArrayList<>()) + .build(); + taskStore.save(task); + + // This is used to send events from a mock + List events = List.of( + new TaskArtifactUpdateEvent.Builder() + .taskId(task.getId()) + .contextId(task.getContextId()) + .artifact(new Artifact.Builder() + .artifactId("11") + .parts(new TextPart("text")) + .build()) + .build(), + new TaskStatusUpdateEvent.Builder() + .taskId(task.getId()) + .contextId(task.getContextId()) + .status(new io.a2a.spec.TaskStatus(io.a2a.spec.TaskState.WORKING)) + .build()); + + StreamRecorder streamRecorder; + try (MockedConstruction mocked = Mockito.mockConstruction( + EventConsumer.class, + (mock, context) -> { + Mockito.doReturn(ZeroPublisher.fromIterable(events)).when(mock).consumeAll();})){ + streamRecorder = sendStreamingMessageRequest(handler); + } + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertEquals(2, result.size()); + StreamResponse first = result.get(0); + assertTrue(first.hasArtifactUpdate()); + io.a2a.grpc.TaskArtifactUpdateEvent taskArtifactUpdateEvent = first.getArtifactUpdate(); + assertEquals(task.getId(), taskArtifactUpdateEvent.getTaskId()); + assertEquals(task.getContextId(), taskArtifactUpdateEvent.getContextId()); + assertEquals("11", taskArtifactUpdateEvent.getArtifact().getArtifactId()); + assertEquals("text", taskArtifactUpdateEvent.getArtifact().getParts(0).getText()); + StreamResponse second = result.get(1); + assertTrue(second.hasStatusUpdate()); + io.a2a.grpc.TaskStatusUpdateEvent taskStatusUpdateEvent = second.getStatusUpdate(); + assertEquals(task.getId(), taskStatusUpdateEvent.getTaskId()); + assertEquals(task.getContextId(), taskStatusUpdateEvent.getContextId()); + assertEquals(TaskState.TASK_STATE_WORKING, taskStatusUpdateEvent.getStatus().getState()); + } + + @Test + public void testOnMessageStreamNewMessageSendPushNotificationSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + List events = List.of( + MINIMAL_TASK, + new TaskArtifactUpdateEvent.Builder() + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .artifact(new Artifact.Builder() + .artifactId("11") + .parts(new TextPart("text")) + .build()) + .build(), + new TaskStatusUpdateEvent.Builder() + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .status(new io.a2a.spec.TaskStatus(io.a2a.spec.TaskState.COMPLETED)) + .build()); + + + agentExecutorExecute = (context, eventQueue) -> { + // Hardcode the events to send here + for (Event event : events) { + eventQueue.enqueueEvent(event); + } + }; + + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + StreamRecorder pushStreamRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + assertNull(pushStreamRecorder.getError()); + + List results = new ArrayList<>(); + List errors = new ArrayList<>(); + final CountDownLatch latch = new CountDownLatch(6); + httpClient.latch = latch; + StreamObserver streamObserver = new StreamObserver<>() { + @Override + public void onNext(StreamResponse streamResponse) { + results.add(streamResponse); + latch.countDown(); + } + + @Override + public void onError(Throwable throwable) { + errors.add(throwable); + } + + @Override + public void onCompleted() { + } + }; + sendStreamingMessageRequest(handler, streamObserver); + assertTrue(latch.await(5, TimeUnit.SECONDS)); + assertTrue(errors.isEmpty()); + assertEquals(3, results.size()); + assertEquals(3, httpClient.tasks.size()); + + io.a2a.spec.Task curr = httpClient.tasks.get(0); + assertEquals(MINIMAL_TASK.getId(), curr.getId()); + assertEquals(MINIMAL_TASK.getContextId(), curr.getContextId()); + assertEquals(MINIMAL_TASK.getStatus().state(), curr.getStatus().state()); + assertEquals(0, curr.getArtifacts() == null ? 0 : curr.getArtifacts().size()); + + curr = httpClient.tasks.get(1); + assertEquals(MINIMAL_TASK.getId(), curr.getId()); + assertEquals(MINIMAL_TASK.getContextId(), curr.getContextId()); + assertEquals(MINIMAL_TASK.getStatus().state(), curr.getStatus().state()); + assertEquals(1, curr.getArtifacts().size()); + assertEquals(1, curr.getArtifacts().get(0).parts().size()); + assertEquals("text", ((TextPart)curr.getArtifacts().get(0).parts().get(0)).getText()); + + curr = httpClient.tasks.get(2); + assertEquals(MINIMAL_TASK.getId(), curr.getId()); + assertEquals(MINIMAL_TASK.getContextId(), curr.getContextId()); + assertEquals(io.a2a.spec.TaskState.COMPLETED, curr.getStatus().state()); + assertEquals(1, curr.getArtifacts().size()); + assertEquals(1, curr.getArtifacts().get(0).parts().size()); + assertEquals("text", ((TextPart)curr.getArtifacts().get(0).parts().get(0)).getText()); + } + + @Test + public void testOnResubscribeNoExistingTaskError() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + TaskSubscriptionRequest request = TaskSubscriptionRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.taskSubscription(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + assertGrpcError(streamRecorder, Status.Code.NOT_FOUND); + } + + @Test + public void testOnResubscribeExistingTaskSuccess() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + queueManager.createOrTap(MINIMAL_TASK.getId()); + + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getMessage()); + }; + + StreamRecorder streamRecorder = StreamRecorder.create(); + TaskSubscriptionRequest request = TaskSubscriptionRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + handler.taskSubscription(request, streamRecorder); + + // We need to send some events in order for those to end up in the queue + SendMessageRequest sendMessageRequest = SendMessageRequest.newBuilder() + .setRequest(GRPC_MESSAGE) + .build(); + StreamRecorder messageRecorder = StreamRecorder.create(); + handler.sendStreamingMessage(sendMessageRequest, messageRecorder); + messageRecorder.awaitCompletion(5, TimeUnit.SECONDS); + assertNull(messageRecorder.getError()); + + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + List result = streamRecorder.getValues(); + assertNotNull(result); + assertEquals(1, result.size()); + StreamResponse response = result.get(0); + assertTrue(response.hasMsg()); + assertEquals(GRPC_MESSAGE, response.getMsg()); + assertNull(streamRecorder.getError()); + } + + @Test + public void testOnResubscribeExistingTaskSuccessMocks() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + queueManager.createOrTap(MINIMAL_TASK.getId()); + + List events = List.of( + new TaskArtifactUpdateEvent.Builder() + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .artifact(new Artifact.Builder() + .artifactId("11") + .parts(new TextPart("text")) + .build()) + .build(), + new TaskStatusUpdateEvent.Builder() + .taskId(MINIMAL_TASK.getId()) + .contextId(MINIMAL_TASK.getContextId()) + .status(new io.a2a.spec.TaskStatus(io.a2a.spec.TaskState.WORKING)) + .build()); + + StreamRecorder streamRecorder = StreamRecorder.create(); + TaskSubscriptionRequest request = TaskSubscriptionRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + try (MockedConstruction mocked = Mockito.mockConstruction( + EventConsumer.class, + (mock, context) -> { + Mockito.doReturn(ZeroPublisher.fromIterable(events)).when(mock).consumeAll();})){ + handler.taskSubscription(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + } + List result = streamRecorder.getValues(); + assertEquals(events.size(), result.size()); + StreamResponse first = result.get(0); + assertTrue(first.hasArtifactUpdate()); + io.a2a.grpc.TaskArtifactUpdateEvent event = first.getArtifactUpdate(); + assertEquals("11", event.getArtifact().getArtifactId()); + assertEquals("text", (event.getArtifact().getParts(0)).getText()); + StreamResponse second = result.get(1); + assertTrue(second.hasStatusUpdate()); + assertEquals(TaskState.TASK_STATE_WORKING, second.getStatusUpdate().getStatus().getState()); + } + + @Test + public void testStreamingNotSupportedError() throws Exception { + AgentCard card = createAgentCard(false, true, true); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + StreamRecorder streamRecorder = sendStreamingMessageRequest(handler); + assertGrpcError(streamRecorder, Status.Code.INVALID_ARGUMENT); + } + + @Test + public void testStreamingNotSupportedErrorOnResubscribeToTask() throws Exception { + // This test does not exist in the Python implementation + AgentCard card = createAgentCard(false, true, true); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + TaskSubscriptionRequest request = TaskSubscriptionRequest.newBuilder() + .setName("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.taskSubscription(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + assertGrpcError(streamRecorder, Status.Code.INVALID_ARGUMENT); + } + + @Test + public void testOnMessageStreamInternalError() throws Exception { + DefaultRequestHandler mocked = Mockito.mock(DefaultRequestHandler.class); + Mockito.doThrow(new InternalError("Internal Error")).when(mocked).onMessageSendStream(Mockito.any(MessageSendParams.class), Mockito.any(ServerCallContext.class)); + GrpcHandler handler = new GrpcHandler(CARD, mocked); + StreamRecorder streamRecorder = sendStreamingMessageRequest(handler); + assertGrpcError(streamRecorder, Status.Code.INTERNAL); + } + + @Test + public void testListPushNotificationConfig() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + StreamRecorder pushRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + assertNull(pushRecorder.getError()); + + ListTaskPushNotificationConfigRequest request = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.listTaskPushNotificationConfig(request, streamRecorder); + assertNull(streamRecorder.getError()); + List result = streamRecorder.getValues(); + assertEquals(1, result.size()); + List configList = result.get(0).getConfigsList(); + assertEquals(1, configList.size()); + assertEquals(pushRecorder.getValues().get(0), configList.get(0)); + } + + @Test + public void testListPushNotificationConfigNotSupported() throws Exception { + AgentCard card = createAgentCard(true, false, true); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + taskStore.save(MINIMAL_TASK); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + ListTaskPushNotificationConfigRequest request = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.listTaskPushNotificationConfig(request, streamRecorder); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testListPushNotificationConfigNoPushConfigStore() { + DefaultRequestHandler requestHandler = + new DefaultRequestHandler(executor, taskStore, queueManager, null, null, internalExecutor); + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + ListTaskPushNotificationConfigRequest request = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.listTaskPushNotificationConfig(request, streamRecorder); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testListPushNotificationConfigTaskNotFound() { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + ListTaskPushNotificationConfigRequest request = ListTaskPushNotificationConfigRequest.newBuilder() + .setParent("tasks/" + MINIMAL_TASK.getId()) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.listTaskPushNotificationConfig(request, streamRecorder); + assertGrpcError(streamRecorder, Status.Code.NOT_FOUND); + } + + @Test + public void testDeletePushNotificationConfig() throws Exception { + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + taskStore.save(MINIMAL_TASK); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + StreamRecorder pushRecorder = createTaskPushNotificationConfigRequest(handler, NAME); + assertNull(pushRecorder.getError()); + + DeleteTaskPushNotificationConfigRequest request = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName(NAME) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.deleteTaskPushNotificationConfig(request, streamRecorder); + assertNull(streamRecorder.getError()); + assertEquals(1, streamRecorder.getValues().size()); + assertEquals(Empty.getDefaultInstance(), streamRecorder.getValues().get(0)); + } + + @Test + public void testDeletePushNotificationConfigNotSupported() throws Exception { + AgentCard card = createAgentCard(true, false, true); + GrpcHandler handler = new GrpcHandler(card, requestHandler); + taskStore.save(MINIMAL_TASK); + agentExecutorExecute = (context, eventQueue) -> { + eventQueue.enqueueEvent(context.getTask() != null ? context.getTask() : context.getMessage()); + }; + + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + DeleteTaskPushNotificationConfigRequest request = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName(NAME) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.deleteTaskPushNotificationConfig(request, streamRecorder); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + @Test + public void testDeletePushNotificationConfigNoPushConfigStore() { + DefaultRequestHandler requestHandler = + new DefaultRequestHandler(executor, taskStore, queueManager, null, null, internalExecutor); + GrpcHandler handler = new GrpcHandler(CARD, requestHandler); + String NAME = "tasks/" + MINIMAL_TASK.getId() + "/pushNotificationConfigs/" + MINIMAL_TASK.getId(); + DeleteTaskPushNotificationConfigRequest request = DeleteTaskPushNotificationConfigRequest.newBuilder() + .setName(NAME) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.deleteTaskPushNotificationConfig(request, streamRecorder); + assertGrpcError(streamRecorder, Status.Code.UNIMPLEMENTED); + } + + private StreamRecorder sendMessageRequest(GrpcHandler handler) throws Exception { + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(GRPC_MESSAGE) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.sendMessage(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + return streamRecorder; + } + + private StreamRecorder createTaskPushNotificationConfigRequest(GrpcHandler handler, String name) throws Exception { + taskStore.save(MINIMAL_TASK); + PushNotificationConfig config = PushNotificationConfig.newBuilder() + .setUrl("http://example.com") + .build(); + TaskPushNotificationConfig taskPushNotificationConfig = TaskPushNotificationConfig.newBuilder() + .setName(name) + .setPushNotificationConfig(config) + .build(); + CreateTaskPushNotificationConfigRequest setRequest = CreateTaskPushNotificationConfigRequest.newBuilder() + .setConfig(taskPushNotificationConfig) + .build(); + + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.createTaskPushNotificationConfig(setRequest, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + return streamRecorder; + } + + private StreamRecorder getTaskPushNotificationConfigRequest(GrpcHandler handler, String name) throws Exception { + GetTaskPushNotificationConfigRequest request = GetTaskPushNotificationConfigRequest.newBuilder() + .setName(name) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.getTaskPushNotificationConfig(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + return streamRecorder; + } + + private StreamRecorder sendStreamingMessageRequest(GrpcHandler handler) throws Exception { + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(GRPC_MESSAGE) + .build(); + StreamRecorder streamRecorder = StreamRecorder.create(); + handler.sendStreamingMessage(request, streamRecorder); + streamRecorder.awaitCompletion(5, TimeUnit.SECONDS); + return streamRecorder; + } + + private void sendStreamingMessageRequest(GrpcHandler handler, StreamObserver streamObserver) throws Exception { + SendMessageRequest request = SendMessageRequest.newBuilder() + .setRequest(GRPC_MESSAGE) + .build(); + handler.sendStreamingMessage(request, streamObserver); + } + + private void assertGrpcError(StreamRecorder streamRecorder, Status.Code expectedStatusCode) { + assertNotNull(streamRecorder.getError()); + assertInstanceOf(StatusRuntimeException.class, streamRecorder.getError()); + assertEquals(expectedStatusCode, ((StatusRuntimeException) streamRecorder.getError()).getStatus().getCode()); + assertTrue(streamRecorder.getValues().isEmpty()); + } +} diff --git a/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/JSONRPCHandlerTest.java b/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/JSONRPCHandlerTest.java index f67fa87cf..1851a5a90 100644 --- a/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/JSONRPCHandlerTest.java +++ b/sdk-server-common/src/test/java/io/a2a/server/requesthandlers/JSONRPCHandlerTest.java @@ -8,40 +8,21 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.Flow; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Consumer; -import jakarta.enterprise.context.Dependent; - -import io.a2a.http.A2AHttpClient; -import io.a2a.http.A2AHttpResponse; import io.a2a.server.ServerCallContext; -import io.a2a.server.agentexecution.AgentExecutor; -import io.a2a.server.agentexecution.RequestContext; import io.a2a.server.auth.UnauthenticatedUser; import io.a2a.server.events.EventConsumer; -import io.a2a.server.events.EventQueue; -import io.a2a.server.events.InMemoryQueueManager; -import io.a2a.server.tasks.BasePushNotificationSender; -import io.a2a.server.tasks.InMemoryPushNotificationConfigStore; -import io.a2a.server.tasks.InMemoryTaskStore; -import io.a2a.server.tasks.PushNotificationConfigStore; -import io.a2a.server.tasks.PushNotificationSender; import io.a2a.server.tasks.ResultAggregator; -import io.a2a.server.tasks.TaskStore; import io.a2a.server.tasks.TaskUpdater; -import io.a2a.spec.AgentCapabilities; import io.a2a.spec.AgentCard; import io.a2a.spec.Artifact; import io.a2a.spec.CancelTaskRequest; @@ -57,7 +38,6 @@ import io.a2a.spec.GetTaskResponse; import io.a2a.spec.InternalError; import io.a2a.spec.InvalidRequestError; -import io.a2a.spec.JSONRPCError; import io.a2a.spec.ListTaskPushNotificationConfigParams; import io.a2a.spec.ListTaskPushNotificationConfigRequest; import io.a2a.spec.ListTaskPushNotificationConfigResponse; @@ -84,78 +64,16 @@ import io.a2a.spec.TaskStatusUpdateEvent; import io.a2a.spec.TextPart; import io.a2a.spec.UnsupportedOperationError; -import io.a2a.util.Utils; -import io.quarkus.arc.profile.IfBuildProfile; import mutiny.zero.ZeroPublisher; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.MockedConstruction; import org.mockito.Mockito; -public class JSONRPCHandlerTest { - - private static final AgentCard CARD = createAgentCard(true, true, true); - - private static final Task MINIMAL_TASK = new Task.Builder() - .id("task-123") - .contextId("session-xyz") - .status(new TaskStatus(TaskState.SUBMITTED)) - .build(); - - private static final Message MESSAGE = new Message.Builder() - .messageId("111") - .role(Message.Role.AGENT) - .parts(new TextPart("test message")) - .build(); - - AgentExecutor executor; - TaskStore taskStore; - RequestHandler requestHandler; - AgentExecutorMethod agentExecutorExecute; - AgentExecutorMethod agentExecutorCancel; - private InMemoryQueueManager queueManager; - private TestHttpClient httpClient; - - private final Executor internalExecutor = Executors.newCachedThreadPool(); +public class JSONRPCHandlerTest extends AbstractA2ARequestHandlerTest { private final ServerCallContext callContext = new ServerCallContext(UnauthenticatedUser.INSTANCE, Map.of("foo", "bar")); - - @BeforeEach - public void init() { - executor = new AgentExecutor() { - @Override - public void execute(RequestContext context, EventQueue eventQueue) throws JSONRPCError { - if (agentExecutorExecute != null) { - agentExecutorExecute.invoke(context, eventQueue); - } - } - - @Override - public void cancel(RequestContext context, EventQueue eventQueue) throws JSONRPCError { - if (agentExecutorCancel != null) { - agentExecutorCancel.invoke(context, eventQueue); - } - } - }; - - taskStore = new InMemoryTaskStore(); - queueManager = new InMemoryQueueManager(); - httpClient = new TestHttpClient(); - PushNotificationConfigStore pushConfigStore = new InMemoryPushNotificationConfigStore(); - PushNotificationSender pushSender = new BasePushNotificationSender(pushConfigStore, httpClient); - - requestHandler = new DefaultRequestHandler(executor, taskStore, queueManager, pushConfigStore, pushSender, internalExecutor); - } - - @AfterEach - public void cleanup() { - agentExecutorExecute = null; - agentExecutorCancel = null; - } - @Test public void testOnGetTaskSuccess() throws Exception { JSONRPCHandler handler = new JSONRPCHandler(CARD, requestHandler); @@ -1436,92 +1354,4 @@ public void testDeletePushNotificationConfigNoPushConfigStore() { assertInstanceOf(UnsupportedOperationError.class, deleteResponse.getError()); } - private static AgentCard createAgentCard(boolean streaming, boolean pushNotifications, boolean stateTransitionHistory) { - return new AgentCard.Builder() - .name("test-card") - .description("A test agent card") - .url("http://example.com") - .version("1.0") - .documentationUrl("http://example.com/docs") - .capabilities(new AgentCapabilities.Builder() - .streaming(streaming) - .pushNotifications(pushNotifications) - .stateTransitionHistory(stateTransitionHistory) - .build()) - .defaultInputModes(new ArrayList<>()) - .defaultOutputModes(new ArrayList<>()) - .skills(new ArrayList<>()) - .protocolVersion("0.2.5") - .build(); - } - - private interface AgentExecutorMethod { - void invoke(RequestContext context, EventQueue eventQueue) throws JSONRPCError; - } - - @Dependent - @IfBuildProfile("test") - private static class TestHttpClient implements A2AHttpClient { - final List tasks = Collections.synchronizedList(new ArrayList<>()); - volatile CountDownLatch latch; - - @Override - public GetBuilder createGet() { - return null; - } - - @Override - public PostBuilder createPost() { - return new TestPostBuilder(); - } - - class TestPostBuilder implements A2AHttpClient.PostBuilder { - private volatile String body; - @Override - public PostBuilder body(String body) { - this.body = body; - return this; - } - - @Override - public A2AHttpResponse post() throws IOException, InterruptedException { - tasks.add(Utils.OBJECT_MAPPER.readValue(body, Task.TYPE_REFERENCE)); - try { - return new A2AHttpResponse() { - @Override - public int status() { - return 200; - } - - @Override - public boolean success() { - return true; - } - - @Override - public String body() { - return ""; - } - }; - } finally { - latch.countDown(); - } - } - - @Override - public CompletableFuture postAsyncSSE(Consumer messageConsumer, Consumer errorConsumer, Runnable completeRunnable) throws IOException, InterruptedException { - return null; - } - - @Override - public PostBuilder url(String s) { - return this; - } - - @Override - public PostBuilder addHeader(String name, String value) { - return this; - } - } - } } diff --git a/tests/server-common/src/test/resources/META-INF/beans.xml b/tests/server-common/src/test/resources/META-INF/beans.xml index 9dfae34df..b0e6ff3e2 100644 --- a/tests/server-common/src/test/resources/META-INF/beans.xml +++ b/tests/server-common/src/test/resources/META-INF/beans.xml @@ -1,6 +1,7 @@ + - \ No newline at end of file +