{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xtiles-app/json-schema/xtiles-app-write-table-rows-response-schema.json",
  "title": "WriteTableRowsResponse",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xtiles-app-openapi.json#/components/schemas/WriteTableRowsResponse",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TableRowResult"
      }
    },
    "summary": {
      "$ref": "#/$defs/TableWriteSummary"
    },
    "created_options": {
      "type": "array",
      "description": "Only present when the request set `allow_new_options: true`: the options this call created, one entry per new option, in creation order. Options created before a failure stay and are listed.",
      "items": {
        "$ref": "#/$defs/CreatedTableOption"
      }
    }
  },
  "$defs": {
    "CreatedTableOption": {
      "type": "object",
      "properties": {
        "column_id": {
          "type": "string",
          "description": "The column the option was added to, by the id its schema carries."
        },
        "label": {
          "type": "string",
          "description": "The option's label, trimmed, exactly as it now reads in the table."
        }
      },
      "description": "Only present when the request set `allow_new_options: true`: the options this call created, one entry per new option, in creation order. Options created before a failure stay and are listed."
    },
    "TableRowResult": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "format": "int32"
        },
        "op": {
          "type": "string",
          "enum": [
            "create",
            "update",
            "delete"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "created",
            "updated",
            "deleted",
            "unchanged",
            "not_found",
            "invalid",
            "failed",
            "skipped"
          ]
        },
        "row_id": {
          "type": "string"
        },
        "changed": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "error": {
          "type": "string"
        },
        "allowed": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "did_you_mean": {
          "type": "string",
          "description": "On a refused select/multiselect/priority value: the existing option it was most likely meant to be (same letters ignoring case and spacing, or one or two letters off; for an option under four characters only case or two swapped letters). Null when none is close, or when several are equally close (the error then names them all)."
        }
      }
    },
    "TableWriteSummary": {
      "type": "object",
      "properties": {
        "created": {
          "type": "integer",
          "format": "int32"
        },
        "updated": {
          "type": "integer",
          "format": "int32"
        },
        "deleted": {
          "type": "integer",
          "format": "int32"
        },
        "unchanged": {
          "type": "integer",
          "format": "int32"
        },
        "failed": {
          "type": "integer",
          "format": "int32"
        },
        "skipped": {
          "type": "integer",
          "format": "int32"
        }
      }
    }
  }
}