{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Device app. Acknowledges one delivery: outcome received after the whole file was downloaded, its CID, size and sha256 matched the manifest and a decoder frame was prepared without starting playback (playbackReady true); outcome failed with the failure stage otherwise. received is final and counts the work's originals as used; a failure consumes nothing. The same requestKey replays the first answer.",
      "errors": [
        {
          "name": "NotMember"
        },
        {
          "name": "DeliveryNotFound"
        },
        {
          "name": "NotDevice"
        },
        {
          "name": "DeliveryMismatch"
        },
        {
          "name": "DeliveryWithdrawn"
        },
        {
          "name": "RequestConflict"
        },
        {
          "name": "DeliveryExpired"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "blobCid": {
              "format": "cid",
              "type": "string"
            },
            "byteSize": {
              "maximum": 314572800,
              "minimum": 0,
              "type": "integer"
            },
            "contentHash": {
              "maxLength": 128,
              "type": "string"
            },
            "deliveryId": {
              "maxLength": 64,
              "type": "string"
            },
            "failure": {
              "knownValues": [
                "download",
                "size",
                "hash",
                "storage",
                "metadata",
                "decode"
              ],
              "type": "string"
            },
            "homeId": {
              "format": "tid",
              "type": "string"
            },
            "outcome": {
              "knownValues": [
                "received",
                "failed"
              ],
              "type": "string"
            },
            "playbackReady": {
              "description": "Required true for received after complete metadata and decoder-frame verification, without starting playback.",
              "type": "boolean"
            },
            "requestKey": {
              "description": "Client-chosen idempotency key (1 to 64 characters of A-Za-z0-9._:-), new for each user action and reused when the same request is sent again after a lost answer. The same key with the same input replays the first answer; the same key with other input is RequestConflict.",
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "homeId",
            "deliveryId",
            "outcome",
            "requestKey"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "delivery": {
              "ref": "ai.newnal.illi.artwork.defs#deliveryView",
              "type": "ref"
            },
            "recorded": {
              "description": "false when the same acknowledgement had been recorded before.",
              "type": "boolean"
            }
          },
          "required": [
            "delivery",
            "recorded"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "ai.newnal.illi.artwork.ackDelivery",
  "lexicon": 1
}
