a2a_protocol_types/generated/responses.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Tom F. <[email protected]> (https://github.com/tomtom215)
3// @generated by tools/a2a-codegen from proto/a2a_v1/a2a.proto,
4// sha256 e195bf96ab630c69797851970203e1b2b6b19528f2e9803b7d904b91a5104016.
5// Included by the `responses` module. Do not edit: change the proto or
6// crates/a2a-protocol-types/codegen.toml and regenerate (ADR 0016).
7
8/// Result object for `ListTasks` method containing an array of tasks and pagination information.
9#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
10#[serde(rename_all = "camelCase")]
11#[non_exhaustive]
12pub struct TaskListResponse {
13 /// Array of tasks matching the specified criteria.
14 ///
15 /// `ProtoJSON` printers omit empty repeated fields, so an official-SDK
16 /// server with zero matching tasks legitimately sends no `tasks` key.
17 #[serde(default)]
18 pub tasks: Vec<crate::task::Task>,
19 /// A token to retrieve the next page of results, or empty if there are no more results in the list.
20 ///
21 /// Empty on the last page; `ProtoJSON` omits an empty string, so absent reads as empty.
22 #[serde(alias = "next_page_token", default)]
23 pub next_page_token: String,
24 /// The page size used for this response.
25 #[serde(alias = "page_size", default)]
26 pub page_size: u32,
27 /// Total number of tasks available (before pagination).
28 #[serde(alias = "total_size", default)]
29 pub total_size: u32,
30}
31
32/// Represents the response for the `SendMessage` method.
33///
34/// In JSON this is the proto's `oneof payload`, externally tagged:
35/// `{"task": {...}}` or `{"message": {...}}`.
36#[derive(Debug, Clone, serde::Serialize)]
37#[serde(rename_all = "camelCase")]
38#[non_exhaustive]
39pub enum SendMessageResponse {
40 /// The task created or updated by the message.
41 Task(crate::task::Task),
42 /// A message from the agent.
43 Message(crate::message::Message),
44}
45
46crate::oneof::oneof_deserialize!(
47 SendMessageResponse,
48 [
49 Task(crate::task::Task) = "task",
50 Message(crate::message::Message) = "message",
51 ]
52);
53
54/// Represents a successful response for the `ListTaskPushNotificationConfigs`
55/// method.
56#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
57#[serde(rename_all = "camelCase")]
58#[non_exhaustive]
59pub struct ListPushConfigsResponse {
60 /// The list of push notification configurations.
61 ///
62 /// `ProtoJSON` printers omit empty repeated fields, so absence means empty.
63 #[serde(default)]
64 pub configs: Vec<crate::push::TaskPushNotificationConfig>,
65 /// A token to retrieve the next page of results, or empty if there are no more results in the list.
66 #[serde(alias = "next_page_token", skip_serializing_if = "Option::is_none")]
67 pub next_page_token: Option<String>,
68}