{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-update-related-item-request-schema.json",
  "title": "UpdateRelatedItemRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-connect-related-items-api-openapi.yml#/components/schemas/UpdateRelatedItemRequest",
  "type": "object",
  "properties": {
    "domainId": {
      "type": "string",
      "description": "The unique identifier of the Cases domain."
    },
    "caseId": {
      "type": "string",
      "description": "A unique identifier of the case."
    },
    "relatedItemId": {
      "type": "string",
      "description": "Unique identifier of a related item."
    },
    "content": {
      "$ref": "#/$defs/RelatedItemUpdateContent"
    },
    "performedBy": {
      "$ref": "#/$defs/UserUnion"
    }
  },
  "required": [
    "domainId",
    "caseId",
    "relatedItemId",
    "content"
  ],
  "$defs": {
    "CasesFieldValue": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of a field."
        },
        "value": {
          "$ref": "#/$defs/CasesFieldValueUnion"
        }
      },
      "required": [
        "id",
        "value"
      ]
    },
    "CasesFieldValueUnion": {
      "type": "object",
      "properties": {
        "stringValue": {
          "type": "string",
          "description": "String value type."
        },
        "doubleValue": {
          "type": "number",
          "description": "Can be either null, or have a Double number value type. Only one value can be provided."
        },
        "booleanValue": {
          "type": "boolean",
          "description": "Can be either null, or have a Boolean value type. Only one value can be provided."
        },
        "emptyValue": {
          "$ref": "#/$defs/EmptyFieldValue"
        },
        "userArnValue": {
          "type": "string",
          "description": "Represents the user that performed the audit."
        }
      },
      "description": "Exactly one member is set."
    },
    "CommentUpdateContent": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string",
          "description": "Updated text in the body of a Comment on a case."
        },
        "contentType": {
          "type": "string",
          "description": "Type of the text in the box of a Comment on a case."
        }
      },
      "required": [
        "body",
        "contentType"
      ]
    },
    "CustomUpdateContent": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CasesFieldValue"
          },
          "description": "List of updated field values for the Custom related item. All existing and new fields, and their associated values should be included. Fields not included as part of this request will be removed."
        }
      },
      "required": [
        "fields"
      ]
    },
    "EmptyFieldValue": {
      "type": "object",
      "properties": {}
    },
    "RelatedItemUpdateContent": {
      "type": "object",
      "properties": {
        "comment": {
          "$ref": "#/$defs/CommentUpdateContent"
        },
        "custom": {
          "$ref": "#/$defs/CustomUpdateContent"
        }
      },
      "description": "Exactly one member is set."
    },
    "UserUnion": {
      "type": "object",
      "properties": {
        "userArn": {
          "type": "string",
          "description": "Represents the Connect Customer ARN of the user."
        },
        "customEntity": {
          "type": "string",
          "description": "Any provided entity."
        }
      },
      "description": "Exactly one member is set."
    }
  }
}