{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Asks the AppView to verify one repo the client copied to its PDS. The AppView syncs the repo from the PDS and compares it with its own copy. On a match the PDS becomes the source of truth. On a mismatch the repo stays hosted by the AppView, and the client may try again.",
      "errors": [
        {
          "description": "The request has no valid service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The arguments are inconsistent or malformed beyond schema validation.",
          "name": "InvalidRequest"
        },
        {
          "description": "No space matches the given space reference.",
          "name": "SpaceNotFound"
        },
        {
          "description": "The caller may not write to or read from this repo in the space.",
          "name": "NotAuthorized"
        },
        {
          "description": "The AppView does not host the caller's repo in this space, because it lives on the caller's PDS. Write to the PDS instead.",
          "name": "RepoNotHosted"
        },
        {
          "description": "The repo is not in the migrating state.",
          "name": "MigrationNotStarted"
        },
        {
          "description": "The PDS copy could not be read or did not match.",
          "name": "VerificationFailed"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "space": {
              "description": "The space holding the repo.",
              "format": "space-ref",
              "type": "string"
            }
          },
          "required": [
            "space"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "missing": {
              "description": "Records the AppView holds that the PDS copy lacks or differs on, when verification fails.",
              "items": {
                "format": "at-uri",
                "type": "string"
              },
              "type": "array"
            },
            "mode": {
              "description": "Where the user's repos live after this call.",
              "ref": "social.colibri.beta.polyfill.defs#hostMode",
              "type": "ref"
            }
          },
          "required": [
            "mode"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.polyfill.completeMigration",
  "lexicon": 1
}
