Represents a single update to a resource.
Roughly corresponds to a JSON Patch operation as per RFC6902. Be aware that DSpace defines custom semantics on top of JSON Patch, and "copy" and "test" operations are not implemented.
Examples
%DSpace.API.Resource{
op: :replace,
path: "/metadata/dc.title/0/value",
value: "New Title"
}
Summary
Functions
Creates an update structure to add a value.
Creates a new update structure from a wire format map.
Creates an update structure to move a value.
Creates a new update structure.
Creates an update structure to remove a value.
Creates an update structure to replace a value.
Converts an update structure to a wire format map.
Types
@type op() :: :add | :remove | :replace | :move
@type t() :: %DSpace.API.Model.ResourceUpdate{ from: binary() | nil, op: op(), path: binary(), value: term() | nil }
A single update to a resource.
op- The update operation to perform::add- Sets the value at the target path. Replaces the value if it already exists.:remove- Removes the value at the target path.valueis not required.:replace- Replaces an existing value at the target path. Fails if no value exists.:move- Moves the value fromfromtopath.valueis not required.
path- JSON Pointer to the target location (e.g."/metadata/dc.title/0/value")value- The value to place at the target path. Required for:addand:replace.from- Source JSON Pointer, only used with:move.
Functions
Creates an update structure to add a value.
Creates a new update structure from a wire format map.
Creates an update structure to move a value.
Creates a new update structure.
Creates an update structure to remove a value.
Creates an update structure to replace a value.
Converts an update structure to a wire format map.