#[non_exhaustive]pub struct SetResponse<T> {
pub account_id: Id,
pub old_state: Option<State>,
pub new_state: State,
pub created: BTreeMap<String, T>,
pub updated: BTreeMap<Id, Option<T>>,
pub destroyed: Vec<Id>,
pub not_created: BTreeMap<String, SetError>,
pub not_updated: BTreeMap<Id, SetError>,
pub not_destroyed: BTreeMap<Id, SetError>,
pub extra: Map<String, Value>,
}Expand description
RFC 8620 §5.3 — Foo/set response shape.
Wire shape per RFC 8620 §5.3 (rfc8620.txt §5.3 around line 2033):
created Id[Foo] | null
updated Id[Foo|null] | null ← inner null is REQUIRED
destroyed Id[] | null
notCreated Id[SetError] | null
notUpdated Id[SetError] | null
notDestroyed Id[SetError] | nullThe inner null in updated is the server’s signal that the patch was
applied verbatim with no server-set property deltas to report; a typed
SetResponse<Foo> MUST accept this rather than failing because null
cannot become Foo.
created and not_created keys are caller-supplied creation ids
(String); updated, not_updated, not_destroyed keys are
server-assigned record ids (Id) — typed differently so callers can
use updated/destroyed keys interchangeably with ids from any
/get response.
The result maps and lists are plain collections, not Options: RFC 8620
defines each as “null if none”, so an empty collection means none. A
null or absent field decodes as empty and an empty one encodes as
null.
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.account_id: IdThe account the response refers to.
old_state: Option<State>State token before this /set was applied. Optional because some
servers omit it on no-op responses (per RFC 8620 §5.3 the field is
nullable).
new_state: StateState token after this /set.
created: BTreeMap<String, T>Successfully created objects, keyed by caller-supplied creation id.
updated: BTreeMap<Id, Option<T>>Successfully updated objects, keyed by record id. The value is
Some(T) when the server reports server-set property deltas, or
None when the patch was applied verbatim with nothing to echo.
destroyed: Vec<Id>Ids of successfully destroyed objects.
not_created: BTreeMap<String, SetError>Failed creates, keyed by caller-supplied creation id.
not_updated: BTreeMap<Id, SetError>Failed updates, keyed by record id.
not_destroyed: BTreeMap<Id, SetError>Failed destroys, keyed by record id.
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).