{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-update-data-table-primary-values-request-schema.json",
  "title": "UpdateDataTablePrimaryValuesRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-values-api-openapi.yml#/components/schemas/UpdateDataTablePrimaryValuesRequest",
  "type": "object",
  "properties": {
    "InstanceId": {
      "type": "string",
      "description": "The unique identifier for the Amazon Connect instance."
    },
    "DataTableId": {
      "type": "string",
      "description": "The unique identifier for the data table. Must also accept the table ARN with or without a version alias. If the version is provided as part of the identifier or ARN, the version must be one of the two available system managed aliases, $SAVED or $LATEST."
    },
    "PrimaryValues": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PrimaryValue"
      },
      "description": "The current primary values for the record. Required and must include values for all primary attributes. Fails if the table has primary attributes and some primary values are omitted."
    },
    "NewPrimaryValues": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PrimaryValue"
      },
      "description": "The new primary values for the record. Required and must include values for all primary attributes. The combination must be unique within the table."
    },
    "LockVersion": {
      "$ref": "#/$defs/DataTableLockVersion"
    }
  },
  "required": [
    "InstanceId",
    "DataTableId",
    "PrimaryValues",
    "NewPrimaryValues",
    "LockVersion"
  ],
  "$defs": {
    "DataTableLockVersion": {
      "type": "object",
      "properties": {
        "DataTable": {
          "type": "string",
          "description": "The lock version for the data table itself. Used for optimistic locking and table versioning. Changes with each update to the table's metadata or structure."
        },
        "Attribute": {
          "type": "string",
          "description": "The lock version for a specific attribute. When the ValueLockLevel is ATTRIBUTE, this version changes when any value for the attribute changes. For other lock levels, it only changes when the attribute's properties are directly updated."
        },
        "PrimaryValues": {
          "type": "string",
          "description": "The lock version for a specific set of primary values (record). This includes the default record even if the table does not have any primary attributes. Used for record-level locking."
        },
        "Value": {
          "type": "string",
          "description": "The lock version for a specific value. Changes each time the individual value is modified. Used for the finest-grained locking control."
        }
      }
    },
    "PrimaryValue": {
      "type": "object",
      "properties": {
        "AttributeName": {
          "type": "string",
          "description": "The name of the primary attribute that this value belongs to."
        },
        "Value": {
          "type": "string",
          "description": "The actual value for the primary attribute. Must be provided as a string regardless of the attribute's value type. Primary values cannot be expressions and must be explicitly specified."
        }
      },
      "required": [
        "AttributeName",
        "Value"
      ]
    }
  }
}