comAtprotoRepoCreateRecord top-level constant

Map<String, dynamic> const comAtprotoRepoCreateRecord

com.atproto.repo.createRecord

Implementation

const comAtprotoRepoCreateRecord = <String, dynamic>{
  "lexicon": 1,
  "id": "com.atproto.repo.createRecord",
  "defs": {
    "main": {
      "type": "procedure",
      "description":
          "Create a single new repository record. Requires auth, implemented by PDS.",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["repo", "collection", "record"],
          "properties": {
            "repo": {
              "type": "string",
              "format": "at-identifier",
              "description":
                  "The handle or DID of the repo (aka, current account)."
            },
            "collection": {
              "type": "string",
              "format": "nsid",
              "description": "The NSID of the record collection."
            },
            "rkey": {
              "type": "string",
              "description": "The Record Key.",
              "maxLength": 15
            },
            "validate": {
              "type": "boolean",
              "description":
                  "Can be set to 'false' to skip Lexicon schema validation of record data.",
              "default": true
            },
            "record": {
              "type": "unknown",
              "description": "The record itself. Must contain a \$type field."
            },
            "swapCommit": {
              "type": "string",
              "format": "cid",
              "description": "Compare and swap with the previous commit by CID."
            }
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["uri", "cid"],
          "properties": {
            "uri": {"type": "string", "format": "at-uri"},
            "cid": {"type": "string", "format": "cid"}
          }
        }
      },
      "errors": [
        {
          "name": "InvalidSwap",
          "description":
              "Indicates that 'swapCommit' didn't match current repo commit."
        }
      ]
    }
  }
};