a2a_protocol_types/generated/push.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 `push` module. Do not edit: change the proto or
6// crates/a2a-protocol-types/codegen.toml and regenerate (ADR 0016).
7
8/// Defines authentication details, used for push notifications.
9///
10/// `credentials` is a secret and is **redacted** in the [`Debug`]
11/// representation (its presence is shown, its value is not) so it cannot leak
12/// into logs via `{:?}`. Serialization is unaffected — the real value is still
13/// sent on the wire.
14#[derive(Clone, serde::Serialize, serde::Deserialize)]
15#[serde(rename_all = "camelCase")]
16#[non_exhaustive]
17pub struct AuthenticationInfo {
18 /// HTTP Authentication Scheme from the \[IANA `registry](https://www.iana.org/assignments/http-authschemes/`).
19 /// Examples: `Bearer`, `Basic`, `Digest`.
20 /// Scheme names are case-insensitive per \[RFC 9110 Section `11.1](https://www.rfc-editor.org/rfc/rfc9110#section-11.1`).
21 pub scheme: String,
22 /// Push Notification credentials. Format depends on the scheme (e.g., token for Bearer).
23 #[serde(skip_serializing_if = "Option::is_none")]
24 pub credentials: Option<String>,
25}
26
27/// A container associating a push notification configuration with a specific task.
28///
29/// `token` is a secret and is **redacted** in the [`Debug`] representation
30/// (presence shown, value hidden), as is any `credentials` inside
31/// `authentication`, so a `{:?}` of a config tree cannot leak the shared
32/// secret into logs. Serialization is unaffected.
33#[derive(Clone, serde::Serialize, serde::Deserialize)]
34#[serde(rename_all = "camelCase")]
35#[non_exhaustive]
36pub struct TaskPushNotificationConfig {
37 /// Optional. Opaque routing identifier. Must match the `tenant` value from
38 /// the selected `AgentInterface` in the Agent Card when that field is set.
39 #[serde(skip_serializing_if = "Option::is_none")]
40 pub tenant: Option<String>,
41 /// The push notification configuration details.
42 /// A unique identifier (e.g. UUID) for this push notification configuration.
43 #[serde(skip_serializing_if = "Option::is_none")]
44 pub id: Option<String>,
45 /// The ID of the task this configuration is associated with.
46 ///
47 /// Optional in the canonical protocol schema: a config nested in
48 /// `SendMessageConfiguration` legitimately omits it (the task does not
49 /// exist yet), and servers assign it from context. A standalone
50 /// `CreateTaskPushNotificationConfig` call does require it — the server
51 /// rejects a missing task ID there with an invalid-params error.
52 #[serde(alias = "task_id", skip_serializing_if = "Option::is_none")]
53 pub task_id: Option<String>,
54 /// The URL where the notification should be sent.
55 pub url: String,
56 /// A token unique for this task or session.
57 #[serde(skip_serializing_if = "Option::is_none")]
58 pub token: Option<String>,
59 /// Authentication information required to send the notification.
60 #[serde(skip_serializing_if = "Option::is_none")]
61 pub authentication: Option<crate::push::AuthenticationInfo>,
62}