{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/4chems-com/json-schema/4chems-com-operation-out-schema.json",
  "title": "OperationOut",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/4chems-com-onboarding-api-openapi.yml#/components/schemas/OperationOut",
  "properties": {
    "operation_id": {
      "type": "string",
      "format": "uuid",
      "title": "Operation Id"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "type": {
      "type": "string",
      "title": "Type"
    },
    "target_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Type"
    },
    "target_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Id"
    },
    "result": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Result"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorDetail"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "finished_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    }
  },
  "type": "object",
  "required": [
    "operation_id",
    "status",
    "type",
    "created_at"
  ],
  "$defs": {
    "ErrorDetail": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        }
      },
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "title": "ErrorDetail"
    }
  }
}