Specifies the behaviour of an API resource.
Summary
Callbacks
Builds an operation to create a new resource on DSpace.
Builds an operation to delete a resource on DSpace.
Builds an operation to fetch a single resource by UUID.
Builds an operation to fetch resources via DSpace search ("discovery").
Builds an operation to fetch a list of resources.
Builds an operation to replace a resource on DSpace.
Builds an operation to update an existing resource on DSpace.
Types
@type dso_uuid() :: binary()
Represents a "DSpace Object" UUID.
Any repository entity (community, collection, item, user, user group, file, etc.) will have a UUID.
@type options() :: keyword()
@type resource_update() :: %{ required(binary()) => binary(), required(binary()) => binary(), optional(binary()) => binary() | nil, optional(binary()) => binary() | nil }
Represents a single metadata update to a resource.
Corresponds to a JSON Patch operation as per RFC6902 ("copy" and "test" operations are not implemented by DSpace). Be aware that DSpace defines custom semantics on top of JSON Patch.
Fields
op- The 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.
Examples
%{"op" => "replace", "path" => "/metadata/dc.title/0/value", "value" => "New Title"}
Callbacks
@callback create(map(), options()) :: DSpace.API.Operation.t()
Builds an operation to create a new resource on DSpace.
@callback delete(binary(), options()) :: DSpace.API.Operation.t()
Builds an operation to delete a resource on DSpace.
@callback fetch(dso_uuid(), options()) :: DSpace.API.Operation.t()
Builds an operation to fetch a single resource by UUID.
@callback find(options()) :: DSpace.API.Operation.t()
Builds an operation to fetch resources via DSpace search ("discovery").
@callback list(options()) :: DSpace.API.Operation.t()
Builds an operation to fetch a list of resources.
@callback replace(dso_uuid(), map(), options()) :: DSpace.API.Operation.t()
Builds an operation to replace a resource on DSpace.
@callback update(dso_uuid(), [resource_update()], options()) :: DSpace.API.Operation.t()
Builds an operation to update an existing resource on DSpace.
The payload is a list of t:DSpace.API.Resource.resource_update.t/0.