{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samesake-co-uk/json-schema/samesake-co-uk-upsert-result-schema.json",
  "title": "UpsertResult",
  "description": "What happened to one record.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samesake-co-uk-openapi.yml#/components/schemas/UpsertResult",
  "required": [
    "sourceRecordId",
    "recordId",
    "outcome"
  ],
  "type": "object",
  "properties": {
    "sourceRecordId": {
      "type": "string",
      "description": "Your ID for the record, as sent (without spaces at either end)."
    },
    "recordId": {
      "type": "string",
      "description": "Samesake's ID for the record. It never changes."
    },
    "outcome": {
      "$ref": "#/$defs/UpsertOutcome"
    }
  },
  "$defs": {
    "UpsertOutcome": {
      "enum": [
        "Created",
        "Updated",
        "Unchanged"
      ],
      "type": "string",
      "description": "`Created`: the source had no record with this ID. `Updated`: the record's details changed, or a deleted record was restored. `Unchanged`: the record already had these details."
    }
  }
}