{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "BlockNodeAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "block"
        },
        "nodeType": {
          "enum": [
            "paragraph",
            "heading",
            "listItem",
            "table",
            "tableRow",
            "tableCell",
            "tableOfContents",
            "image",
            "sdt"
          ]
        },
        "nodeId": {
          "type": "string"
        },
        "story": {
          "$ref": "#/$defs/StoryLocator"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ]
    },
    "StoryLocator": {
      "description": "Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "story"
            },
            "storyType": {
              "const": "body"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "storyType"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "story"
            },
            "storyType": {
              "const": "headerFooterSlot"
            },
            "section": {
              "$ref": "#/$defs/SectionAddress"
            },
            "headerFooterKind": {
              "enum": [
                "header",
                "footer"
              ]
            },
            "variant": {
              "enum": [
                "default",
                "first",
                "even"
              ]
            },
            "resolution": {
              "enum": [
                "effective",
                "explicit"
              ]
            },
            "onWrite": {
              "enum": [
                "materializeIfInherited",
                "editResolvedPart",
                "error"
              ]
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "storyType",
            "section",
            "headerFooterKind",
            "variant"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "story"
            },
            "storyType": {
              "const": "headerFooterPart"
            },
            "refId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "storyType",
            "refId"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "story"
            },
            "storyType": {
              "const": "footnote"
            },
            "noteId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "storyType",
            "noteId"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "story"
            },
            "storyType": {
              "const": "endnote"
            },
            "noteId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "storyType",
            "noteId"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "story"
            },
            "storyType": {
              "const": "textbox"
            },
            "textboxId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "storyType",
            "textboxId"
          ]
        }
      ]
    },
    "SectionAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "section"
        },
        "sectionId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "sectionId"
      ]
    },
    "ReceiptFailure": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "additionalProperties": false,
      "required": [
        "code",
        "message"
      ]
    }
  },
  "operationId": "contentControls.move",
  "schemas": {
    "input": {
      "type": "object",
      "properties": {
        "target": {
          "type": "object",
          "properties": {
            "kind": {
              "enum": [
                "block",
                "inline"
              ]
            },
            "nodeType": {
              "const": "sdt"
            },
            "nodeId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ]
        },
        "destination": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "block",
                    "inline"
                  ]
                },
                "nodeType": {
                  "const": "sdt"
                },
                "nodeId": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "nodeType",
                "nodeId"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "const": "documentStart"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "const": "documentEnd"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "const": "before"
                },
                "target": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "enum": [
                        "block",
                        "inline"
                      ]
                    },
                    "nodeType": {
                      "const": "sdt"
                    },
                    "nodeId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "nodeType",
                    "nodeId"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "target"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "const": "after"
                },
                "target": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "enum": [
                        "block",
                        "inline"
                      ]
                    },
                    "nodeType": {
                      "const": "sdt"
                    },
                    "nodeId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "kind",
                    "nodeType",
                    "nodeId"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "target"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "const": "inParagraph"
                },
                "target": {
                  "$ref": "#/$defs/BlockNodeAddress"
                },
                "offset": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "target"
              ]
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "target",
        "destination"
      ]
    },
    "output": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "contentControl": {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "block",
                    "inline"
                  ]
                },
                "nodeType": {
                  "const": "sdt"
                },
                "nodeId": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "nodeType",
                "nodeId"
              ]
            },
            "updatedRef": {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "block",
                    "inline"
                  ]
                },
                "nodeType": {
                  "const": "sdt"
                },
                "nodeId": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "required": [
                "kind",
                "nodeType",
                "nodeId"
              ]
            }
          },
          "additionalProperties": false,
          "required": [
            "success",
            "contentControl"
          ]
        },
        {
          "type": "object",
          "properties": {
            "success": {
              "const": false
            },
            "failure": {
              "$ref": "#/$defs/ReceiptFailure"
            }
          },
          "additionalProperties": false,
          "required": [
            "success",
            "failure"
          ]
        }
      ]
    },
    "success": {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "contentControl": {
          "type": "object",
          "properties": {
            "kind": {
              "enum": [
                "block",
                "inline"
              ]
            },
            "nodeType": {
              "const": "sdt"
            },
            "nodeId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ]
        },
        "updatedRef": {
          "type": "object",
          "properties": {
            "kind": {
              "enum": [
                "block",
                "inline"
              ]
            },
            "nodeType": {
              "const": "sdt"
            },
            "nodeId": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "nodeType",
            "nodeId"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "contentControl"
      ]
    },
    "failure": {
      "type": "object",
      "properties": {
        "success": {
          "const": false
        },
        "failure": {
          "$ref": "#/$defs/ReceiptFailure"
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "failure"
      ]
    }
  }
}
