#[non_exhaustive]pub struct Media {
pub at_type: Option<String>,
pub kind: Option<String>,
pub uri: Option<String>,
pub media_type: Option<String>,
pub contexts: Option<HashMap<String, bool>>,
pub pref: Option<u32>,
pub label: Option<String>,
pub extra: Map<String, Value>,
}Expand description
A media resource associated with a Card (RFC 9553 §2.6.4).
Extends the abstract Resource type with a mandatory kind value of
"photo", "sound", or "logo".
kind and uri are mandatory on the wire but modelled as Option
to permit partial-response deserialization; callers building a fresh
Media MUST populate both fields. See the crate-level
Design: optional fields and Option<...>
section.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.at_type: Option<String>Object type discriminator; SHOULD be "Media" when present per RFC 9553 §1.3.4 (may be omitted in defaultType positions).
kind: Option<String>"photo", "sound", or "logo". Mandatory per RFC 9553 §2.6.4,
modelled as Option for partial-response deserialization.
uri: Option<String>The resource URI (RFC 3986). Mandatory per RFC 9553 §1.4.4 but
modelled as Option for partial-response deserialization.
media_type: Option<String>IANA media type of the resource.
contexts: Option<HashMap<String, bool>>Contexts in which to use the resource (key → true).
pref: Option<u32>Preference order in 1..=100 (lower = more preferred).
label: Option<String>Custom label for the value.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).