Class SendMessageRequest.Builder
java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.SendMessageRequest.Builder
- Enclosing class:
- SendMessageRequest
Builder for constructing
SendMessageRequest instances with a fluent API.
The method name is automatically set to "SendMessage" and cannot be changed.
If no ID is provided, a UUID will be auto-generated when build() is called.
Example usage:
SendMessageRequest request = SendMessageRequest.builder()
.params(new MessageSendParams(message, taskId, taskPushNotificationConfig))
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the SendMessageRequest.Sets the request correlation ID.Sets the JSON-RPC version.params(MessageSendParams params) Sets the message send parameters (required).
-
Method Details
-
jsonrpc
Sets the JSON-RPC version.- Parameters:
jsonrpc- the JSON-RPC version (typically "2.0")- Returns:
- this builder for method chaining
-
id
Sets the request correlation ID.- Parameters:
id- the request correlation identifier- Returns:
- this builder for method chaining
-
params
Sets the message send parameters (required).- Parameters:
params- the message send parameters- Returns:
- this builder for method chaining
-
build
Builds the SendMessageRequest. Auto-generates a UUID for the ID if not set.- Returns:
- the constructed request
-