{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "ReceiptSuccess": {
      "type": "object",
      "properties": {
        "success": {
          "const": true
        },
        "id": {
          "type": "string"
        },
        "inserted": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntityAddress"
          }
        },
        "updated": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntityAddress"
          }
        },
        "removed": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EntityAddress"
          }
        },
        "invalidatedRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AffectedRef"
          }
        },
        "remappedRefs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AffectedRefRemapping"
          }
        },
        "affectedStories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StoryLocator"
          }
        },
        "textRangeShifts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextRangeShift"
          }
        },
        "txId": {
          "type": "string"
        },
        "warnings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewWarning"
          }
        },
        "effects": {
          "$ref": "#/$defs/ReceiptEffects"
        }
      },
      "additionalProperties": false,
      "required": [
        "success"
      ]
    },
    "EntityAddress": {
      "oneOf": [
        {
          "$ref": "#/$defs/CommentAddress"
        },
        {
          "$ref": "#/$defs/TrackedChangeAddress"
        }
      ]
    },
    "CommentAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "entity"
        },
        "entityType": {
          "const": "comment"
        },
        "entityId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "entityType",
        "entityId"
      ]
    },
    "TrackedChangeAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "entity"
        },
        "entityType": {
          "const": "trackedChange"
        },
        "entityId": {
          "type": "string"
        },
        "story": {
          "$ref": "#/$defs/StoryLocator"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "entityType",
        "entityId"
      ]
    },
    "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"
      ]
    },
    "AffectedRef": {
      "oneOf": [
        {
          "$ref": "#/$defs/TextAddress"
        },
        {
          "$ref": "#/$defs/BookmarkAddress"
        },
        {
          "$ref": "#/$defs/CommentAddress"
        },
        {
          "$ref": "#/$defs/TrackedChangeAddress"
        },
        {
          "$ref": "#/$defs/BlockNavigationAddress"
        }
      ]
    },
    "TextAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "text"
        },
        "blockId": {
          "type": "string"
        },
        "range": {
          "$ref": "#/$defs/Range"
        },
        "story": {
          "$ref": "#/$defs/StoryLocator"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "blockId",
        "range"
      ]
    },
    "Range": {
      "type": "object",
      "properties": {
        "start": {
          "type": "integer"
        },
        "end": {
          "type": "integer"
        }
      },
      "additionalProperties": false,
      "required": [
        "start",
        "end"
      ]
    },
    "BookmarkAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "entity"
        },
        "entityType": {
          "const": "bookmark"
        },
        "name": {
          "type": "string"
        },
        "story": {
          "$ref": "#/$defs/StoryLocator"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "entityType",
        "name"
      ]
    },
    "BlockNavigationAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "block"
        },
        "nodeId": {
          "type": "string"
        },
        "nodeType": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "nodeId"
      ]
    },
    "AffectedRefRemapping": {
      "type": "object",
      "properties": {
        "from": {
          "$ref": "#/$defs/AffectedRef"
        },
        "to": {
          "$ref": "#/$defs/AffectedRef"
        }
      },
      "additionalProperties": false,
      "required": [
        "from",
        "to"
      ]
    },
    "TextRangeShift": {
      "type": "object",
      "properties": {
        "story": {
          "$ref": "#/$defs/StoryLocator"
        },
        "atChar": {
          "type": "integer"
        },
        "blockId": {
          "type": "string"
        },
        "atCharInBlock": {
          "type": "integer"
        },
        "delta": {
          "type": "integer"
        }
      },
      "additionalProperties": false,
      "required": [
        "story",
        "atChar",
        "delta"
      ]
    },
    "ReviewWarning": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "feature": {
          "enum": [
            "comments",
            "trackedChanges"
          ]
        },
        "severity": {
          "const": "warning"
        },
        "affectedObjectId": {
          "type": "string"
        },
        "affectedPartUri": {
          "type": "string"
        },
        "canProceed": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": [
        "code",
        "message",
        "feature",
        "severity",
        "canProceed"
      ]
    },
    "ReceiptEffects": {
      "type": "object",
      "properties": {
        "insertedText": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextMutationEffect"
          }
        },
        "insertedBlocks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BlockMutationEffect"
          }
        }
      },
      "additionalProperties": false
    },
    "TextMutationEffect": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "insertedText"
        },
        "sourcePath": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          }
        },
        "target": {
          "$ref": "#/$defs/TextAddress"
        },
        "selectionTarget": {
          "$ref": "#/$defs/SelectionTarget"
        },
        "text": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "target",
        "selectionTarget",
        "text"
      ]
    },
    "SelectionTarget": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "selection"
        },
        "start": {
          "$ref": "#/$defs/SelectionPoint"
        },
        "end": {
          "$ref": "#/$defs/SelectionPoint"
        },
        "story": {
          "$ref": "#/$defs/StoryLocator"
        },
        "coordinateSpace": {
          "$ref": "#/$defs/TextCoordinateSpace"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "start",
        "end"
      ]
    },
    "SelectionPoint": {
      "description": "A point in the document. Use {kind:'text', blockId, offset} for character positions or {kind:'nodeEdge', node:{kind:'block', nodeType, nodeId}, edge:'before'|'after'} for block boundaries.",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "text"
            },
            "blockId": {
              "type": "string"
            },
            "offset": {
              "type": "integer",
              "minimum": 0
            },
            "story": {
              "$ref": "#/$defs/StoryLocator"
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "blockId",
            "offset"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "nodeEdge"
            },
            "node": {
              "$ref": "#/$defs/SelectionEdgeNodeAddress"
            },
            "edge": {
              "enum": [
                "before",
                "after"
              ]
            }
          },
          "additionalProperties": false,
          "required": [
            "kind",
            "node",
            "edge"
          ]
        }
      ]
    },
    "SelectionEdgeNodeAddress": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "block"
        },
        "nodeType": {
          "enum": [
            "paragraph",
            "heading",
            "table",
            "tableOfContents",
            "sdt",
            "image"
          ]
        },
        "nodeId": {
          "type": "string"
        },
        "story": {
          "$ref": "#/$defs/StoryLocator"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "nodeType",
        "nodeId"
      ]
    },
    "TextCoordinateSpace": {
      "enum": [
        "visible",
        "tracked"
      ]
    },
    "BlockMutationEffect": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "insertedBlock"
        },
        "sourcePath": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          }
        },
        "target": {
          "$ref": "#/$defs/BlockNodeAddress"
        },
        "insertedText": {
          "$ref": "#/$defs/TextMutationEffect"
        }
      },
      "additionalProperties": false,
      "required": [
        "kind",
        "target"
      ]
    },
    "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"
      ]
    }
  },
  "operationId": "comments.delete",
  "schemas": {
    "input": {
      "type": "object",
      "properties": {
        "commentId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "commentId"
      ]
    },
    "output": {
      "oneOf": [
        {
          "$ref": "#/$defs/ReceiptSuccess"
        },
        {
          "type": "object",
          "properties": {
            "success": {
              "const": false
            },
            "failure": {
              "type": "object",
              "properties": {
                "code": {
                  "enum": [
                    "TARGET_NOT_FOUND",
                    "CAPABILITY_UNAVAILABLE",
                    "NO_OP"
                  ]
                },
                "message": {
                  "type": "string"
                },
                "details": {}
              },
              "additionalProperties": false,
              "required": [
                "code",
                "message"
              ]
            }
          },
          "additionalProperties": false,
          "required": [
            "success",
            "failure"
          ]
        }
      ]
    },
    "success": {
      "$ref": "#/$defs/ReceiptSuccess"
    },
    "failure": {
      "type": "object",
      "properties": {
        "success": {
          "const": false
        },
        "failure": {
          "type": "object",
          "properties": {
            "code": {
              "enum": [
                "TARGET_NOT_FOUND",
                "CAPABILITY_UNAVAILABLE",
                "NO_OP"
              ]
            },
            "message": {
              "type": "string"
            },
            "details": {}
          },
          "additionalProperties": false,
          "required": [
            "code",
            "message"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "success",
        "failure"
      ]
    }
  }
}
