{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rivery/json-schema/rivery-operation-response-schema.json",
  "title": "OperationResponse",
  "description": "Operation properties to return.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rivery-connections-api-openapi.yml#/components/schemas/OperationResponse",
  "properties": {
    "operation_id": {
      "type": "string",
      "title": "Operation Id",
      "description": "The ID of the operation"
    },
    "operation_type": {
      "type": "string",
      "title": "Operation Type",
      "description": "The type of the operation"
    },
    "run_id": {
      "type": "string",
      "title": "Run Id",
      "description": "The run id of the operation"
    },
    "last_update_date": {
      "type": "string",
      "format": "date-time",
      "title": "Last Update Date",
      "description": "The date time in UTC timezone of the last update"
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/PullRequestStatus"
        }
      ],
      "description": "The current status of the operation id"
    },
    "result": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Result",
      "description": "The result of the operation"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Message",
      "description": "The error message of the operation"
    }
  },
  "type": "object",
  "required": [
    "operation_id",
    "operation_type",
    "run_id",
    "last_update_date",
    "status"
  ],
  "$defs": {
    "PullRequestStatus": {
      "type": "string",
      "enum": [
        "W",
        "E",
        "R",
        "D"
      ],
      "title": "PullRequestStatus",
      "description": "The status of the pull request that we use in the back, and expose in the API"
    }
  }
}