{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ausca-com/json-schema/ausca-com-get-invocation-result-schema.json",
  "title": "GetInvocationResult",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ausca-com-openapi.json#/components/schemas/GetInvocationResult",
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "invocation": {
          "$ref": "#/$defs/InvocationState"
        },
        "status": {
          "const": "ok"
        }
      },
      "required": [
        "status",
        "invocation"
      ],
      "type": "object"
    },
    {
      "$ref": "#/$defs/RefusedResult"
    }
  ],
  "$defs": {
    "ArtifactEvidence": {
      "additionalProperties": false,
      "properties": {
        "artifact_uri": {
          "$ref": "#/$defs/ArtifactUri"
        },
        "content_digest": {
          "$ref": "#/$defs/Digest"
        },
        "created_at": {
          "format": "date-time",
          "type": "string"
        },
        "media_type": {
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        },
        "size_bytes": {
          "maximum": 26214400,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "artifact_uri",
        "content_digest",
        "media_type",
        "size_bytes",
        "created_at"
      ],
      "type": "object"
    },
    "ArtifactUri": {
      "description": "Opaque artifact reference minted by artifact commitment. Relay it unchanged; its form is not part of the contract.",
      "maxLength": 512,
      "minLength": 1,
      "type": "string"
    },
    "Digest": {
      "pattern": "^sha256:[a-f0-9]{64}$",
      "type": "string"
    },
    "Identifier": {
      "maxLength": 128,
      "minLength": 1,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
      "type": "string"
    },
    "InvocationFailure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "maxLength": 96,
          "minLength": 1,
          "type": "string"
        },
        "message": {
          "maxLength": 500,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "InvocationState": {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "$ref": "#/$defs/InvocationFailure"
        },
        "invocation_id": {
          "$ref": "#/$defs/Identifier"
        },
        "offer_revision_digest": {
          "$ref": "#/$defs/Digest"
        },
        "output": {},
        "output_artifact": {
          "$ref": "#/$defs/ArtifactEvidence"
        },
        "output_digest": {
          "$ref": "#/$defs/Digest"
        },
        "receipt_ref": {
          "$ref": "#/$defs/ReceiptReference"
        },
        "state": {
          "enum": [
            "admitted",
            "running",
            "succeeded",
            "failed",
            "cancellation_requested",
            "cancelled"
          ],
          "type": "string"
        },
        "updated_at": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "invocation_id",
        "offer_revision_digest",
        "state",
        "updated_at"
      ],
      "type": "object"
    },
    "ReceiptReference": {
      "additionalProperties": false,
      "properties": {
        "public_url": {
          "description": "Unguessable public verification page for the privacy-bounded hash-only proof. It reveals the receipt digest, service, public price, and completion time, but not input bytes, output bytes, or their content digests.",
          "format": "uri",
          "maxLength": 2048,
          "pattern": "^https://[^?#]+/r/[a-f0-9]{64}$",
          "type": "string"
        },
        "type": {
          "const": "receipt"
        },
        "uri": {
          "description": "Opaque receipt identity minted by the notary. Relay it unchanged; its form is not part of the contract.",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "type",
        "uri"
      ],
      "type": "object"
    },
    "RefusedResult": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "enum": [
            "offer_unavailable",
            "schema_mismatch",
            "quote_expired",
            "terms_changed",
            "replay_conflict",
            "payment_authority_required",
            "payment_not_authorized",
            "capacity_unavailable",
            "not_found",
            "cancellation_not_available",
            "artifact_gone"
          ],
          "type": "string"
        },
        "reason": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "status": {
          "const": "refused"
        }
      },
      "required": [
        "status",
        "code",
        "reason"
      ],
      "type": "object"
    }
  }
}