{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/apification-com/json-schema/apification-com-file-transformation-job-schema.json",
  "title": "FileTransformationJob",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/apification-com-openapi.json#/components/schemas/FileTransformationJob",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "operation_key": {
      "type": "string"
    },
    "operation_label": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "processing",
        "completed",
        "failed",
        "cancelled"
      ]
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "estimated_credits": {
      "type": "integer"
    },
    "credits_charged": {
      "type": "integer"
    },
    "options": {
      "type": "object"
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "oneOf": [
        {
          "$ref": "#/$defs/CloudService"
        },
        {
          "type": "null"
        }
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FileTransformationResult"
      }
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "finished_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "links": {
      "type": "object"
    }
  },
  "$defs": {
    "CloudFile": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "extension": {
          "type": [
            "string",
            "null"
          ]
        },
        "mime_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "size": {
          "type": "integer"
        },
        "preview_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "content_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "media_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "thumbnail_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    },
    "CloudPermissionCapabilities": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "view": {
          "type": "boolean"
        },
        "edit": {
          "type": "boolean"
        },
        "manage": {
          "type": "boolean"
        }
      }
    },
    "CloudService": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "integer"
        },
        "code": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "type_label": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "visibility": {
          "type": "string",
          "enum": [
            "private",
            "shared",
            "public"
          ]
        },
        "permission": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "viewer",
            "editor",
            "owner",
            null
          ]
        },
        "capabilities": {
          "$ref": "#/$defs/CloudPermissionCapabilities"
        },
        "status": {
          "type": "string"
        },
        "public": {
          "type": "boolean"
        },
        "file": {
          "$ref": "#/$defs/CloudFile"
        },
        "parent_folder_id": {
          "type": [
            "integer",
            "null"
          ]
        },
        "views": {
          "type": "integer"
        },
        "payload": {
          "type": [
            "object",
            "null"
          ]
        },
        "public_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "insert_value": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "FileTransformationResult": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "role": {
          "type": [
            "string",
            "null"
          ]
        },
        "metadata": {
          "type": "object"
        },
        "service": {
          "oneOf": [
            {
              "$ref": "#/$defs/CloudService"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    }
  }
}