fn(request$1027) =>
match match @definy.json-get(value: $1027, key: "items") {
#none(_) =>
#some([]),
#some(value$1028) =>
match $1028 {
#array(items$1029) =>
@definy.json-content-items(items: $1029, index: 0, accum: []),
#null(_) =>
#some([]),
_ =>
#none
}
} {
#none(_) =>
@definy.rpc-error(code: "invalid_argument", message: "items must be a list of {contentHash, contentBytes}"),
#some(items$1030) =>
#hash_contents<@definy.service-io>({
contents_bytes: @definy.content-items-bytes(items: $1030, index: 0, accum: []),
then: fn(hashes$1031) =>
match @definy.content-hash-mismatch(items: $1030, hashes: $1031, index: 0) {
#some(message$1032) =>
@definy.rpc-error(code: "invalid_argument", message: $1032),
#none(_) =>
@definy.store-write-contents(
items: $1030,
then: fn(stored$1033) =>
@definy.json-response(
status: 200,
body: #object<@definy.json>([
{
key: "storedContentHashes",
value: #array<@definy.json>(@definy.json-string-array(items: $1033, index: 0))
}
])
)
)
}
})
}