Skip to main content

a2a_protocol_types/generated/
params.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 `params` module. Do not edit: change the proto or
6// crates/a2a-protocol-types/codegen.toml and regenerate (ADR 0016).
7
8/// Configuration of a send message request.
9#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
10#[serde(rename_all = "camelCase")]
11#[non_exhaustive]
12pub struct SendMessageConfiguration {
13    /// A list of media types the client is prepared to accept for response parts.
14    /// Agents SHOULD use this to tailor their output.
15    ///
16    /// `ProtoJSON` printers (all official SDKs) omit empty repeated fields, so
17    /// absent on the wire means empty — "no preference". Requiring the key
18    /// rejected real official-SDK requests at parse time.
19    #[serde(alias = "accepted_output_modes", default)]
20    pub accepted_output_modes: Vec<String>,
21    /// Configuration for the agent to send push notifications for task updates.
22    /// Task id should be empty when sending this configuration in a `SendMessage` request.
23    #[serde(
24        alias = "task_push_notification_config",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub task_push_notification_config: Option<crate::push::TaskPushNotificationConfig>,
28    /// The maximum number of most recent messages from the task's history to retrieve in
29    /// the response. An unset value means the client does not impose any limit. A
30    /// value of zero is a request to not include any messages. The server MUST NOT
31    /// return more messages than the provided value, but MAY apply a lower limit.
32    #[serde(alias = "history_length", skip_serializing_if = "Option::is_none")]
33    pub history_length: Option<u32>,
34    /// If `true`, the operation returns immediately after creating the task,
35    /// even if processing is still in progress.
36    /// If `false` (default), the operation MUST wait until the task reaches a
37    /// terminal (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or interrupted
38    /// (`INPUT_REQUIRED`, `AUTH_REQUIRED`) state before returning.
39    #[serde(alias = "return_immediately", skip_serializing_if = "Option::is_none")]
40    pub return_immediately: Option<bool>,
41}
42
43/// Represents a request for the `SendMessage` method.
44///
45/// Context is given by `message.context_id`, as the proto defines it.
46#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
47#[serde(rename_all = "camelCase")]
48#[non_exhaustive]
49pub struct MessageSendParams {
50    /// Optional. Opaque routing identifier. Must match the `tenant` value from
51    /// the selected `AgentInterface` in the Agent Card when that field is set.
52    #[serde(skip_serializing_if = "Option::is_none")]
53    pub tenant: Option<String>,
54    /// The message to send to the agent.
55    pub message: crate::message::Message,
56    /// Configuration for the send request.
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub configuration: Option<crate::params::SendMessageConfiguration>,
59    /// A flexible key-value map for passing additional context or parameters.
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub metadata: Option<serde_json::Value>,
62}
63
64/// Represents a request for the `GetTask` method.
65#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
66#[serde(rename_all = "camelCase")]
67#[non_exhaustive]
68pub struct TaskQueryParams {
69    /// Optional. Opaque routing identifier. Must match the `tenant` value from
70    /// the selected `AgentInterface` in the Agent Card when that field is set.
71    #[serde(skip_serializing_if = "Option::is_none")]
72    pub tenant: Option<String>,
73    /// The resource ID of the task to retrieve.
74    pub id: String,
75    /// The maximum number of most recent messages from the task's history to retrieve. An
76    /// unset value means the client does not impose any limit. A value of zero is
77    /// a request to not include any messages. The server MUST NOT return more
78    /// messages than the provided value, but MAY apply a lower limit.
79    #[serde(alias = "history_length", skip_serializing_if = "Option::is_none")]
80    pub history_length: Option<u32>,
81}
82
83/// Parameters for listing tasks with optional filtering criteria.
84///
85/// All fields are optional filters; omitting them returns all tasks visible to
86/// the caller (subject to the server's default page size).
87#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
88#[serde(rename_all = "camelCase")]
89#[non_exhaustive]
90pub struct ListTasksParams {
91    /// Optional. Opaque routing identifier. Must match the `tenant` value from
92    /// the selected `AgentInterface` in the Agent Card when that field is set.
93    #[serde(skip_serializing_if = "Option::is_none")]
94    pub tenant: Option<String>,
95    /// Filter tasks by context ID to get tasks from a specific conversation or session.
96    #[serde(alias = "context_id", skip_serializing_if = "Option::is_none")]
97    pub context_id: Option<String>,
98    /// Filter tasks by their current status state.
99    #[serde(skip_serializing_if = "Option::is_none")]
100    pub status: Option<crate::task::TaskState>,
101    /// The maximum number of tasks to return. The service may return fewer than this value.
102    /// If unspecified, at most 50 tasks will be returned.
103    /// The minimum value is 1.
104    /// The maximum value is 100.
105    ///
106    /// A server refuses a value outside 1 to 100 with `InvalidParams`; a store may
107    /// cap the page lower.
108    #[serde(alias = "page_size", skip_serializing_if = "Option::is_none")]
109    pub page_size: Option<u32>,
110    /// A page token, received from a previous `ListTasks` call.
111    /// `ListTasksResponse.next_page_token`.
112    /// Provide this to retrieve the subsequent page.
113    #[serde(alias = "page_token", skip_serializing_if = "Option::is_none")]
114    pub page_token: Option<String>,
115    /// The maximum number of messages to include in each task's history.
116    #[serde(alias = "history_length", skip_serializing_if = "Option::is_none")]
117    pub history_length: Option<u32>,
118    /// Filter tasks which have a status updated after the provided timestamp in ISO 8601 format (e.g., "2023-10-27T10:00:00Z").
119    /// Only tasks with a status timestamp time greater than or equal to this value will be returned.
120    #[serde(
121        alias = "status_timestamp_after",
122        skip_serializing_if = "Option::is_none"
123    )]
124    pub status_timestamp_after: Option<String>,
125    /// Whether to include artifacts in the returned tasks.
126    /// Defaults to false to reduce payload size.
127    #[serde(alias = "include_artifacts", skip_serializing_if = "Option::is_none")]
128    pub include_artifacts: Option<bool>,
129}
130
131/// Represents a request for the `CancelTask` method.
132#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
133#[serde(rename_all = "camelCase")]
134#[non_exhaustive]
135pub struct CancelTaskParams {
136    /// Optional. Opaque routing identifier. Must match the `tenant` value from
137    /// the selected `AgentInterface` in the Agent Card when that field is set.
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub tenant: Option<String>,
140    /// The resource ID of the task to cancel.
141    pub id: String,
142    /// A flexible key-value map for passing additional context or parameters.
143    #[serde(skip_serializing_if = "Option::is_none")]
144    pub metadata: Option<serde_json::Value>,
145}
146
147/// Represents a request for the `GetTaskPushNotificationConfig` method.
148#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
149#[serde(rename_all = "camelCase")]
150#[non_exhaustive]
151pub struct GetPushConfigParams {
152    /// Optional. Opaque routing identifier. Must match the `tenant` value from
153    /// the selected `AgentInterface` in the Agent Card when that field is set.
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub tenant: Option<String>,
156    /// The parent task resource ID.
157    #[serde(alias = "task_id")]
158    pub task_id: String,
159    /// The resource ID of the configuration to retrieve.
160    pub id: String,
161}
162
163/// Represents a request for the `DeleteTaskPushNotificationConfig` method.
164#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
165#[serde(rename_all = "camelCase")]
166#[non_exhaustive]
167pub struct DeletePushConfigParams {
168    /// Optional. Opaque routing identifier. Must match the `tenant` value from
169    /// the selected `AgentInterface` in the Agent Card when that field is set.
170    #[serde(skip_serializing_if = "Option::is_none")]
171    pub tenant: Option<String>,
172    /// The parent task resource ID.
173    #[serde(alias = "task_id")]
174    pub task_id: String,
175    /// The resource ID of the configuration to delete.
176    pub id: String,
177}
178
179/// Represents a request for the `SubscribeToTask` method.
180#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
181#[serde(rename_all = "camelCase")]
182#[non_exhaustive]
183pub struct TaskIdParams {
184    /// Optional. Opaque routing identifier. Must match the `tenant` value from
185    /// the selected `AgentInterface` in the Agent Card when that field is set.
186    #[serde(skip_serializing_if = "Option::is_none")]
187    pub tenant: Option<String>,
188    /// The resource ID of the task to subscribe to.
189    pub id: String,
190}
191
192/// Represents a request for the `ListTaskPushNotificationConfigs` method.
193#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
194#[serde(rename_all = "camelCase")]
195#[non_exhaustive]
196pub struct ListPushConfigsParams {
197    /// The parent task resource ID.
198    #[serde(alias = "task_id")]
199    pub task_id: String,
200    /// The maximum number of configurations to return.
201    #[serde(alias = "page_size", skip_serializing_if = "Option::is_none")]
202    pub page_size: Option<u32>,
203    /// A page token received from a previous `ListTaskPushNotificationConfigsRequest` call.
204    #[serde(alias = "page_token", skip_serializing_if = "Option::is_none")]
205    pub page_token: Option<String>,
206    /// Optional. Opaque routing identifier. Must match the `tenant` value from
207    /// the selected `AgentInterface` in the Agent Card when that field is set.
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub tenant: Option<String>,
210}
211
212/// Represents a request for the `GetExtendedAgentCard` method.
213#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
214#[serde(rename_all = "camelCase")]
215#[non_exhaustive]
216pub struct GetExtendedAgentCardParams {
217    /// Optional. Opaque routing identifier. Must match the `tenant` value from
218    /// the selected `AgentInterface` in the Agent Card when that field is set.
219    #[serde(skip_serializing_if = "Option::is_none")]
220    pub tenant: Option<String>,
221}