{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-cognito/json-schema/amazon-cognito-update-records-request-schema.json",
  "title": "UpdateRecordsRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-cognito-datasets-api-openapi.yml#/components/schemas/UpdateRecordsRequest",
  "type": "object",
  "properties": {
    "IdentityPoolId": {
      "type": "string",
      "description": "A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region."
    },
    "IdentityId": {
      "type": "string",
      "description": "A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region."
    },
    "DatasetName": {
      "type": "string",
      "description": "A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot)."
    },
    "DeviceId": {
      "type": "string",
      "description": "The unique ID generated for this device by Cognito."
    },
    "RecordPatches": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RecordPatch"
      },
      "description": "A list of patch operations."
    },
    "SyncSessionToken": {
      "type": "string",
      "description": "The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity."
    },
    "ClientContext": {
      "type": "string",
      "description": "Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented."
    }
  },
  "required": [
    "IdentityPoolId",
    "IdentityId",
    "DatasetName",
    "SyncSessionToken"
  ],
  "$defs": {
    "RecordPatch": {
      "type": "object",
      "properties": {
        "Op": {
          "type": "string",
          "enum": [
            "replace",
            "remove"
          ],
          "description": "An operation, either replace or remove."
        },
        "Key": {
          "type": "string",
          "description": "The key associated with the record patch."
        },
        "Value": {
          "type": "string",
          "description": "The value associated with the record patch."
        },
        "SyncCount": {
          "type": "integer",
          "description": "Last known server sync count for this record. Set to 0 if unknown."
        },
        "DeviceLastModifiedDate": {
          "type": "string",
          "format": "date-time",
          "description": "The last modified date of the client device."
        }
      },
      "required": [
        "Op",
        "Key",
        "SyncCount"
      ]
    }
  }
}