Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions client/base/src/main/java/io/a2a/client/AbstractClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import io.a2a.spec.CancelTaskParams;
import io.a2a.spec.DeleteTaskPushNotificationConfigParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.Message;
import io.a2a.spec.MessageSendParams;
Expand Down Expand Up @@ -299,8 +299,8 @@ public abstract TaskPushNotificationConfig getTaskPushNotificationConfiguration(
* @return the result containing the list of task push notification configs and pagination information
* @throws A2AClientException if getting the task push notification configs fails for any reason
*/
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigParams request) throws A2AClientException {
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigsParams request) throws A2AClientException {
return listTaskPushNotificationConfigurations(request, null);
}

Expand All @@ -312,8 +312,8 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
* @return the result containing the list of task push notification configs and pagination information
* @throws A2AClientException if getting the task push notification configs fails for any reason
*/
public abstract ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigParams request,
public abstract ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigsParams request,
@Nullable ClientCallContext context) throws A2AClientException;

/**
Expand Down
16 changes: 8 additions & 8 deletions client/base/src/main/java/io/a2a/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.Message;
import io.a2a.spec.MessageSendConfiguration;
Expand Down Expand Up @@ -512,9 +512,9 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(
* Example:
* <pre>{@code
* // List all configurations for a context
* ListTaskPushNotificationConfigParams params =
* new ListTaskPushNotificationConfigParams("session-123", null, 10, null);
* ListTaskPushNotificationConfigResult result =
* ListTaskPushNotificationConfigsParams params =
* new ListTaskPushNotificationConfigsParams("session-123", null, 10, null);
* ListTaskPushNotificationConfigsResult result =
* client.listTaskPushNotificationConfigurations(params);
* for (TaskPushNotificationConfig config : result.configurations()) {
* System.out.println("Task " + config.taskId() + " -> " +
Expand All @@ -526,11 +526,11 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(
* @param context custom call context for request interceptors (optional)
* @return the list of push notification configurations
* @throws A2AClientException if the configurations cannot be retrieved
* @see ListTaskPushNotificationConfigParams
* @see ListTaskPushNotificationConfigsParams
*/
@Override
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws A2AClientException {
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context) throws A2AClientException {
return clientTransport.listTaskPushNotificationConfigurations(request, context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -271,8 +271,8 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
}

@Override
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigParams request,
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigsParams request,
@Nullable ClientCallContext context) throws A2AClientException {
checkNotNullParam("request", request);

Expand All @@ -288,9 +288,9 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
try {
A2AServiceBlockingV2Stub stubWithMetadata = createBlockingStubWithMetadata(context, payloadAndHeaders);
io.a2a.grpc.ListTaskPushNotificationConfigsResponse grpcResponse = stubWithMetadata.listTaskPushNotificationConfigs(grpcRequest);
return FromProto.listTaskPushNotificationConfigResult(grpcResponse);
return FromProto.listTaskPushNotificationConfigsResult(grpcResponse);
} catch (StatusRuntimeException | StatusException e) {
throw GrpcErrorMapper.mapGrpcError(e, "Failed to list task push notification config: ");
throw GrpcErrorMapper.mapGrpcError(e, "Failed to list task push notification configs: ");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -220,12 +220,12 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
}

@Override
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigParams request,
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigsParams request,
@Nullable ClientCallContext context) throws A2AClientException {
checkNotNullParam("request", request);
PayloadAndHeaders payloadAndHeaders = applyInterceptors(LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD,
ProtoUtils.ToProto.listTaskPushNotificationConfigRequest(request), agentCard, context);
ProtoUtils.ToProto.listTaskPushNotificationConfigsRequest(request), agentCard, context);

try {
String httpResponseBody = sendPostRequest(Utils.buildBaseUrl(agentInterface, request.tenant()), payloadAndHeaders, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -326,7 +326,7 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
}

@Override
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws A2AClientException {
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context) throws A2AClientException {
checkNotNullParam("request", request);
io.a2a.grpc.ListTaskPushNotificationConfigsRequest.Builder builder
= io.a2a.grpc.ListTaskPushNotificationConfigsRequest.newBuilder();
Expand All @@ -348,7 +348,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
String httpResponseBody = response.body();
io.a2a.grpc.ListTaskPushNotificationConfigsResponse.Builder responseBuilder = io.a2a.grpc.ListTaskPushNotificationConfigsResponse.newBuilder();
JsonFormat.parser().merge(httpResponseBody, responseBuilder);
return ProtoUtils.FromProto.listTaskPushNotificationConfigResult(responseBuilder);
return ProtoUtils.FromProto.listTaskPushNotificationConfigsResult(responseBuilder);
} catch (A2AClientException e) {
throw e;
} catch (IOException | InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import io.a2a.spec.FileWithBytes;
import io.a2a.spec.FileWithUri;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.Message;
import io.a2a.spec.MessageSendConfiguration;
import io.a2a.spec.MessageSendParams;
Expand Down Expand Up @@ -357,8 +357,8 @@ public void testListTaskPushNotificationConfigurations() throws Exception {
);

RestTransport client = new RestTransport(CARD);
ListTaskPushNotificationConfigResult result = client.listTaskPushNotificationConfigurations(
new ListTaskPushNotificationConfigParams("de38c76d-d54c-436c-8b9f-4c2703648d64"), null);
ListTaskPushNotificationConfigsResult result = client.listTaskPushNotificationConfigurations(
new ListTaskPushNotificationConfigsParams("de38c76d-d54c-436c-8b9f-4c2703648d64"), null);
assertEquals(2, result.configs().size());
TaskPushNotificationConfig config0 = result.configs().get(0);
assertNotNull(config0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -111,8 +111,8 @@ TaskPushNotificationConfig getTaskPushNotificationConfiguration(
* @return the result containing the list of task push notification configs and pagination information
* @throws A2AClientException if getting the task push notification configs fails for any reason
*/
ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigParams request,
ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(
ListTaskPushNotificationConfigsParams request,
@Nullable ClientCallContext context) throws A2AClientException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -96,7 +96,7 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
}

@Override
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigParams request,
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigsParams request,
@Nullable ClientCallContext context) throws A2AClientException {
return delegate.listTaskPushNotificationConfigurations(request, propagateContext(context));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -306,7 +306,7 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
}

@Override
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigParams request,
public ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigsParams request,
@Nullable ClientCallContext context) throws A2AClientException {
ClientCallContext clientContext = createContext(context);
SpanBuilder spanBuilder = tracer.spanBuilder(A2AMethods.LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD).setSpanKind(SpanKind.CLIENT);
Expand All @@ -319,7 +319,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
}
Span span = spanBuilder.startSpan();
try (Scope scope = span.makeCurrent()) {
ListTaskPushNotificationConfigResult result = delegate.listTaskPushNotificationConfigurations(request, clientContext);
ListTaskPushNotificationConfigsResult result = delegate.listTaskPushNotificationConfigurations(request, clientContext);
if (result != null && extractResponse()) {
String responseValue = result.configs().stream()
.map(TaskPushNotificationConfig::toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import io.a2a.spec.EventKind;
import io.a2a.spec.GetExtendedAgentCardParams;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.Message;
import io.a2a.spec.MessageSendParams;
Expand Down Expand Up @@ -262,16 +262,16 @@ void testGetTaskPushNotificationConfiguration_Success() throws A2AClientExceptio

@Test
void testListTaskPushNotificationConfigurations_Success() throws A2AClientException {
ListTaskPushNotificationConfigParams request = mock(ListTaskPushNotificationConfigParams.class);
ListTaskPushNotificationConfigsParams request = mock(ListTaskPushNotificationConfigsParams.class);
TaskPushNotificationConfig config1 = mock(TaskPushNotificationConfig.class);
TaskPushNotificationConfig config2 = mock(TaskPushNotificationConfig.class);
when(config1.toString()).thenReturn("config1");
when(config2.toString()).thenReturn("config2");
ListTaskPushNotificationConfigResult expectedResult = new ListTaskPushNotificationConfigResult(List.of(config1, config2));
ListTaskPushNotificationConfigsResult expectedResult = new ListTaskPushNotificationConfigsResult(List.of(config1, config2));
when(request.toString()).thenReturn("request-string");
when(delegate.listTaskPushNotificationConfigurations(eq(request), any(ClientCallContext.class))).thenReturn(expectedResult);

ListTaskPushNotificationConfigResult result = transport.listTaskPushNotificationConfigurations(request, context);
ListTaskPushNotificationConfigsResult result = transport.listTaskPushNotificationConfigurations(request, context);

assertEquals(expectedResult, result);
verify(tracer).spanBuilder(A2AMethods.LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import io.a2a.spec.DeleteTaskPushNotificationConfigParams;
import io.a2a.spec.EventKind;
import io.a2a.spec.GetTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigParams;
import io.a2a.spec.ListTaskPushNotificationConfigResult;
import io.a2a.spec.ListTaskPushNotificationConfigsParams;
import io.a2a.spec.ListTaskPushNotificationConfigsResult;
import io.a2a.spec.ListTasksParams;
import io.a2a.spec.MessageSendParams;
import io.a2a.spec.StreamingEventKind;
Expand Down Expand Up @@ -396,7 +396,7 @@ public Flow.Publisher<StreamingEventKind> onSubscribeToTask(TaskIdParams params,
}

@Override
public ListTaskPushNotificationConfigResult onListTaskPushNotificationConfig(ListTaskPushNotificationConfigParams params, ServerCallContext context) throws A2AError {
public ListTaskPushNotificationConfigsResult onListTaskPushNotificationConfigs(ListTaskPushNotificationConfigsParams params, ServerCallContext context) throws A2AError {
var spanBuilder = tracer.spanBuilder(A2AMethods.LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD)
.setSpanKind(SpanKind.SERVER)
.setAttribute(GENAI_OPERATION_NAME, A2AMethods.LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
Expand All @@ -411,7 +411,7 @@ public ListTaskPushNotificationConfigResult onListTaskPushNotificationConfig(Lis
Span span = spanBuilder.startSpan();

try (Scope scope = span.makeCurrent()) {
ListTaskPushNotificationConfigResult result = delegate.onListTaskPushNotificationConfig(params, context);
ListTaskPushNotificationConfigsResult result = delegate.onListTaskPushNotificationConfigs(params, context);

if (result != null && extractResponse()) {
span.setAttribute(GENAI_RESPONSE, result.toString());
Expand Down
Loading
Loading