Skip to main content

a2a_protocol_types/generated/
artifact.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 `artifact` module. Do not edit: change the proto or
6// crates/a2a-protocol-types/codegen.toml and regenerate (ADR 0016).
7
8/// Artifacts represent task outputs.
9#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
10#[serde(rename_all = "camelCase")]
11#[non_exhaustive]
12pub struct Artifact {
13    /// Unique identifier (e.g. UUID) for the artifact. It must be unique within a task.
14    #[serde(rename = "artifactId", alias = "artifact_id")]
15    pub id: crate::artifact::ArtifactId,
16    /// A human readable name for the artifact.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// Optional. A human readable description of the artifact.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// The content of the artifact. Must contain at least one part.
23    ///
24    /// **Spec requirement:** Must contain at least one element. The A2A
25    /// protocol does not define behavior for empty parts lists.
26    ///
27    /// Parsing treats absence as empty (`ProtoJSON` printers omit empty
28    /// repeated fields; the gRPC binding already decodes it that way) — the
29    /// server-side event processors drop empty-parts artifacts explicitly.
30    #[serde(default)]
31    pub parts: Vec<crate::message::Part>,
32    /// Optional. Metadata included with the artifact.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub metadata: Option<serde_json::Value>,
35    /// The URIs of extensions that are present or contributed to this Artifact.
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub extensions: Option<Vec<String>>,
38}