{
  "type": "object",
  "properties": {
    "billing_event": {
      "type": [
        "string",
        "null"
      ]
    },
    "billing_quantity": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1
    },
    "checked_at": {
      "type": "string",
      "format": "date-time"
    },
    "company_website": {
      "type": [
        "null",
        "string"
      ]
    },
    "completed_at": {
      "type": "string",
      "format": "date-time"
    },
    "coverage_complete": {
      "type": "boolean"
    },
    "downloaded_bytes": {
      "type": "integer",
      "minimum": 0
    },
    "duration_ms": {
      "type": "integer",
      "minimum": 0
    },
    "http_request_count": {
      "type": "integer",
      "minimum": 0
    },
    "integration": {
      "type": [
        "null",
        "object"
      ],
      "properties": {
        "checked_at": {
          "type": "string",
          "format": "date-time"
        },
        "evidence_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "evidence_text": {
          "type": "string"
        },
        "integration_name": {
          "type": "string"
        },
        "source_title": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "verification_scope": {
          "type": "string"
        }
      },
      "required": [
        "checked_at",
        "evidence_sha256",
        "evidence_text",
        "integration_name",
        "source_title",
        "source_url",
        "verification_scope"
      ],
      "additionalProperties": false
    },
    "integration_name": {
      "type": [
        "null",
        "string"
      ]
    },
    "message": {
      "type": "string"
    },
    "report_id": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "schema_version": {
      "const": "1.0"
    },
    "source_errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "error_code": {
            "type": "string"
          },
          "url": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "required": [
          "error_code",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "discovered_from": {
            "type": [
              "null",
              "string"
            ]
          },
          "evidence_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_type": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "checked_at",
          "discovered_from",
          "evidence_sha256",
          "source_type",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "status": {
      "enum": [
        "verified_integration",
        "unknown",
        "invalid_input"
      ]
    }
  },
  "required": [
    "billing_event",
    "billing_quantity",
    "checked_at",
    "company_website",
    "completed_at",
    "coverage_complete",
    "downloaded_bytes",
    "duration_ms",
    "http_request_count",
    "integration",
    "integration_name",
    "message",
    "report_id",
    "schema_version",
    "source_errors",
    "sources",
    "status"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Software Integration Checker — Verified Evidence report"
}
