{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-job-result-schema.json",
  "title": "JobResult",
  "description": "The result of a completed job.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-aem-folders-openapi.yml#/components/schemas/JobResult",
  "anyOf": [
    {
      "$ref": "#/$defs/CreateFoldersCommandResult"
    },
    {
      "$ref": "#/$defs/DeleteFoldersCommandResult"
    },
    {
      "$ref": "#/$defs/MoveFoldersCommandResult"
    },
    {
      "$ref": "#/$defs/CopyFoldersCommandResult"
    }
  ],
  "$defs": {
    "CommandResult": {
      "description": "The result of a command. A command is an operation that changes a system in a different way than via a CRUD\nrequest to a resource.\n",
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "description": "The operation that was performed.",
          "minLength": 1
        },
        "status": {
          "type": "integer",
          "format": "int32",
          "description": "The HTTP status code ([RFC9110, Section 15](https://www.rfc-editor.org/rfc/rfc9110.html#section-15))\ngenerated by the origin server corresponding to this operation.\n"
        },
        "description": {
          "type": "string",
          "description": "A human-readable explanation specific to this command, explaining the status.",
          "minLength": 1
        },
        "data": {
          "type": "object",
          "description": "The data returned by the operation, which will vary by the implementing command. Each command\nMUST provide its own schema definition for this object, by defining all the properties a client is\nexpected to encounter.\n"
        },
        "errors": {
          "type": "array",
          "description": "An optional array of errors that occurred during the operation.",
          "items": {
            "$ref": "#/$defs/CommandResultMessage"
          }
        },
        "warnings": {
          "type": "array",
          "description": "An optional array of warnings that occurred during the operation.",
          "items": {
            "$ref": "#/$defs/CommandResultMessage"
          }
        }
      },
      "required": [
        "operation",
        "status",
        "description"
      ]
    },
    "CommandResultMessage": {
      "description": "CommandResultMessage Object to encapsulate the result of a command.",
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "A URI reference [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) that identifies the message type.",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "description": "A short, human-readable summary of the problem type.",
          "minLength": 1
        },
        "detail": {
          "type": "string",
          "description": "A human-readable explanation specific to this occurrence of the problem."
        },
        "context": {
          "type": "object",
          "description": "An optional object containing additional context information about the problem.\n\nEach command MUST provide its own schema definition for this object, by defining all the properties a client is\nexpected to encounter.\n"
        }
      },
      "required": [
        "type",
        "title"
      ]
    },
    "CopiedFolderResultItem": {
      "type": "object",
      "description": "The result of a single folder copy operation.",
      "additionalProperties": false,
      "properties": {
        "sourceId": {
          "type": "string",
          "description": "The ID of the original source folder. Returned regardless of whether the request used BY_ID or BY_PATH addressing."
        },
        "sourcePath": {
          "type": "string",
          "description": "The absolute path of the source folder at the time of the operation."
        },
        "id": {
          "type": "string",
          "description": "The ID of the newly created copy. This is a different ID from sourceId."
        },
        "path": {
          "type": "string",
          "description": "The absolute path of the newly created copy."
        },
        "destinationParentId": {
          "type": "string",
          "description": "The ID of the parent folder the copy was placed under."
        },
        "destinationParentPath": {
          "type": "string",
          "description": "The absolute path of the parent folder the copy was placed under."
        }
      },
      "required": [
        "sourceId",
        "sourcePath",
        "id",
        "path",
        "destinationParentId",
        "destinationParentPath"
      ]
    },
    "CopyFoldersCommandResult": {
      "description": "The result of an `adobe.folders.copyFolders` command.\n",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "default": "adobe.folders.copyFolders"
            },
            "data": {
              "type": "object",
              "description": "Copy Folders Command Result",
              "properties": {
                "copiedFolders": {
                  "type": "array",
                  "description": "Per-item results for the copy operation. Each entry corresponds to one successfully copied folder.",
                  "maxItems": 10,
                  "items": {
                    "$ref": "#/$defs/CopiedFolderResultItem"
                  }
                },
                "failedFolders": {
                  "$ref": "#/$defs/FailedFolders"
                }
              },
              "required": [
                "copiedFolders"
              ]
            }
          }
        },
        {
          "$ref": "#/$defs/CommandResult"
        }
      ],
      "required": [
        "operation"
      ]
    },
    "CreateFoldersCommandResult": {
      "description": "The result of an `adobe.folders.createFolders` command.\n",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "default": "adobe.folders.createFolders"
            },
            "data": {
              "$ref": "#/$defs/CreateFoldersCommandResultData"
            }
          }
        },
        {
          "$ref": "#/$defs/CommandResult"
        }
      ],
      "required": [
        "operation"
      ]
    },
    "CreateFoldersCommandResultData": {
      "type": "object",
      "properties": {
        "values": {
          "type": "object",
          "properties": {
            "successes": {
              "type": "array",
              "maxItems": 10,
              "items": {
                "$ref": "#/$defs/Folder"
              }
            },
            "failedFolders": {
              "$ref": "#/$defs/FailedFolders"
            }
          }
        }
      }
    },
    "DeleteFoldersCommandResult": {
      "description": "The result of an `adobe.folders.deleteFolders` command.\n",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "default": "adobe.folders.deleteFolders"
            },
            "data": {
              "type": "object",
              "description": "Delete Folders Command Result",
              "properties": {
                "deletedFolders": {
                  "type": "array",
                  "maxItems": 10,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "failedFolders": {
                  "$ref": "#/$defs/FailedFolders"
                }
              }
            }
          }
        },
        {
          "$ref": "#/$defs/CommandResult"
        }
      ],
      "required": [
        "operation"
      ]
    },
    "FailedFolderItem": {
      "description": "A folder that failed to be processed during a folders command. Combines the problem\ndetails of the failure with the identity of the folder to which it applies.\n\nAt least one of `path` or `id` identifies the folder. Path-addressed operations\n(`createFolders`, `deleteFoldersByPath`, `moveFolders`/`copyFolders` by path) populate\n`path`, and `id` is included when known. Id-addressed operations (`moveFolders`/\n`copyFolders` by id) populate `id`; `path` is included once the id resolves to a folder.\n",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1,
              "description": "The path of the folder to which this failure applies, when known."
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "description": "The unique identifier of the folder to which this failure applies, when known."
            }
          },
          "anyOf": [
            {
              "required": [
                "path"
              ]
            },
            {
              "required": [
                "id"
              ]
            }
          ]
        },
        {
          "$ref": "#/$defs/CommandResultMessage"
        }
      ]
    },
    "FailedFolders": {
      "type": "array",
      "description": "An optional array of folders that failed to be processed during the operation.",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/FailedFolderItem"
      }
    },
    "Folder": {
      "description": "A reference to a folder. Only high-level properties are included.",
      "allOf": [
        {
          "$ref": "#/$defs/FolderListingItem"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "description": "The type of this listing item. Always `FOLDER` for folder entries.\n",
              "allOf": [
                {
                  "$ref": "#/$defs/FolderListingItemType"
                }
              ],
              "default": "FOLDER",
              "readOnly": true
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "The name of the folder, usually the last node of the path."
            },
            "title": {
              "type": [
                "string",
                "null"
              ],
              "description": "The title of the folder for display purposes.\n"
            },
            "folderId": {
              "type": "string",
              "minLength": 1,
              "description": "The unique identifier for the folder",
              "readOnly": true
            },
            "path": {
              "type": "string",
              "minLength": 1,
              "description": "The path to the folder",
              "readOnly": true
            }
          },
          "required": [
            "type",
            "folderId",
            "name",
            "path"
          ]
        }
      ]
    },
    "FolderListingItem": {
      "description": "A single item in a folder listing response. Can be either a folder or an asset,\ndiscriminated by the `type` property.\n",
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/FolderListingItemType"
        }
      },
      "required": [
        "type"
      ]
    },
    "FolderListingItemType": {
      "description": "The type of resource in a folder listing response.\nUsed as the filter value in the `types` query parameter.\n",
      "type": "string",
      "enum": [
        "FOLDER",
        "ASSET"
      ]
    },
    "MoveFoldersCommandResult": {
      "description": "The result of an `adobe.folders.moveFolders` command.\n",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "default": "adobe.folders.moveFolders"
            },
            "data": {
              "type": "object",
              "description": "Move Folders Command Result",
              "properties": {
                "movedFolders": {
                  "type": "array",
                  "description": "Per-item results for the move operation.",
                  "maxItems": 10,
                  "items": {
                    "$ref": "#/$defs/MovedFolderResultItem"
                  }
                },
                "failedFolders": {
                  "$ref": "#/$defs/FailedFolders"
                }
              },
              "required": [
                "movedFolders"
              ]
            }
          }
        },
        {
          "$ref": "#/$defs/CommandResult"
        }
      ],
      "required": [
        "operation"
      ]
    },
    "MovedFolderResultItem": {
      "type": "object",
      "description": "The result of a single folder move operation.",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the moved folder. This is the same ID as before the move — the folder entity does not change, only its location."
        },
        "path": {
          "type": "string",
          "description": "The final absolute path after the move."
        },
        "sourcePath": {
          "type": "string",
          "description": "The absolute path of the folder before the move."
        },
        "previousParentId": {
          "type": "string",
          "description": "The ID of the parent folder before the move."
        },
        "previousParentPath": {
          "type": "string",
          "description": "The absolute path of the parent folder before the move."
        },
        "destinationParentId": {
          "type": "string",
          "description": "The ID of the parent folder the folder was moved into."
        },
        "destinationParentPath": {
          "type": "string",
          "description": "The absolute path of the parent folder the folder was moved into."
        }
      },
      "required": [
        "id",
        "path",
        "sourcePath",
        "previousParentId",
        "previousParentPath",
        "destinationParentId",
        "destinationParentPath"
      ]
    }
  }
}