{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coloringbookify-com/json-schema/coloringbookify-com-operation-list-envelope-schema.json",
  "title": "OperationListEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coloringbookify-com-operations-api-openapi.yml#/components/schemas/OperationListEnvelope",
  "allOf": [
    {
      "$ref": "#/$defs/PaginatedEnvelope"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Operation"
          }
        }
      }
    }
  ],
  "$defs": {
    "Links": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "Operation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "action": {
          "type": "string",
          "enum": [
            "character.create",
            "character.regenerate",
            "book.create",
            "page.create",
            "page.regenerate"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "running",
            "succeeded",
            "partially_succeeded",
            "failed"
          ]
        },
        "credits": {
          "type": "object",
          "properties": {
            "charged": {
              "type": "integer"
            },
            "refunded": {
              "type": "integer"
            }
          }
        },
        "progress": {
          "type": "object",
          "additionalProperties": true
        },
        "resource": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "id": {
              "type": "string"
            },
            "link": {
              "type": "string"
            }
          }
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "started_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finished_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "links": {
          "$ref": "#/$defs/Links"
        }
      }
    },
    "PaginatedEnvelope": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array"
        },
        "meta": {
          "type": "object",
          "properties": {
            "limit": {
              "type": "integer"
            },
            "next_cursor": {
              "type": [
                "string",
                "null"
              ]
            },
            "has_more": {
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}