Expand description
draft-ietf-jmap-conditional-02 wire types: the capability, the
ifUnchangedBy and atomic Foo/set arguments, and the
stateMismatch, atomicFailure and cannotApplyAtomically method
errors.
The two new error codes are &str constants used with
JmapError::custom, like other extension codes: they decode to
MethodErrorType::Other, and no
MethodErrorType variant is added
(docs/design/DECISIONS.md decision 7). Their extra properties live in
JmapError::extra, read and written by the constructors and readers
here.
§Example
use jmap_types::JmapError;
use jmap_types::conditional::{AtomicFailure, ATOMIC_FAILURE};
let err = JmapError::state_mismatch_failed(vec![jmap_types::Id::from("f42")]);
assert_eq!(
serde_json::to_value(&err).unwrap(),
serde_json::json!({"type": "stateMismatch", "failed": ["f42"]})
);
let err = JmapError::atomic_failure(AtomicFailure::default());
assert_eq!(err.error_type.as_str(), ATOMIC_FAILURE);Structs§
- Atomic
Failure - The details of an
atomicFailureerror (§4.2): the Foo/set-shapednotCreated,notUpdatedandnotDestroyedmaps, each optional (“A server MAY report only the first failure it encounters”). - Conditional
Capability - The Session capability object (§2.1): “The value of this property MUST
be an empty object.” Unknown members are kept in
extra. - Conditional
SetArgs - The two §3 Foo/set arguments, for a client to merge into a Foo/set
call. Defaults (empty
ifUnchangedBy,atomicfalse) are not written.
Constants§
- ATOMIC_
FAILURE - The
atomicFailuremethod error (§4.2, §8.2): an atomic Foo/set could not commit all its changes, so it made none. - CANNOT_
APPLY_ ATOMICALLY - The
cannotApplyAtomicallymethod error (§4.3, §8.3): the server cannot commit this Foo/set as a unit, so it made no change. - JMAP_
CONDITIONAL_ URI - The capability URI (§2.1, §8.1).
Type Aliases§
- IfUnchanged
By - The
ifUnchangedByargument (§3):"Id[PatchObject|null]".