{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-connect/json-schema/amazon-connect-create-related-item-request-schema.json",
  "title": "CreateRelatedItemRequest",
  "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/CreateRelatedItemRequest",
  "type": "object",
  "properties": {
    "domainId": {
      "type": "string",
      "description": "The unique identifier of the Cases domain."
    },
    "caseId": {
      "type": "string",
      "description": "A unique identifier of the case."
    },
    "type": {
      "type": "string",
      "description": "The type of a related item."
    },
    "content": {
      "$ref": "#/$defs/RelatedItemInputContent"
    },
    "performedBy": {
      "$ref": "#/$defs/UserUnion"
    }
  },
  "required": [
    "domainId",
    "caseId",
    "type",
    "content"
  ],
  "$defs": {
    "CasesContact": {
      "type": "object",
      "properties": {
        "contactArn": {
          "type": "string",
          "description": "A unique identifier of a contact in Connect Customer."
        }
      },
      "required": [
        "contactArn"
      ]
    },
    "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."
    },
    "CommentContent": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string",
          "description": "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"
      ]
    },
    "ConnectCaseInputContent": {
      "type": "object",
      "properties": {
        "caseId": {
          "type": "string",
          "description": "A unique identifier of the case."
        }
      },
      "required": [
        "caseId"
      ]
    },
    "CustomInputContent": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CasesFieldValue"
          },
          "description": "List of field values for the Custom related item."
        }
      },
      "required": [
        "fields"
      ]
    },
    "EmptyFieldValue": {
      "type": "object",
      "properties": {}
    },
    "FileContent": {
      "type": "object",
      "properties": {
        "fileArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of a File in Connect Customer."
        }
      },
      "required": [
        "fileArn"
      ]
    },
    "RelatedItemInputContent": {
      "type": "object",
      "properties": {
        "contact": {
          "$ref": "#/$defs/CasesContact"
        },
        "comment": {
          "$ref": "#/$defs/CommentContent"
        },
        "file": {
          "$ref": "#/$defs/FileContent"
        },
        "sla": {
          "$ref": "#/$defs/SlaInputContent"
        },
        "connectCase": {
          "$ref": "#/$defs/ConnectCaseInputContent"
        },
        "custom": {
          "$ref": "#/$defs/CustomInputContent"
        }
      },
      "description": "Exactly one member is set."
    },
    "SlaInputConfiguration": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of an SLA."
        },
        "type": {
          "type": "string",
          "description": "Type of SLA."
        },
        "fieldId": {
          "type": "string",
          "description": "Unique identifier of a field."
        },
        "targetFieldValues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CasesFieldValueUnion"
          },
          "description": "Represents a list of target field values for the fieldId specified in SlaInputConfiguration. The SLA is considered met if any one of these target field values matches the actual field value."
        },
        "targetSlaMinutes": {
          "type": "integer",
          "description": "Target duration in minutes within which an SLA should be completed."
        }
      },
      "required": [
        "name",
        "type",
        "targetSlaMinutes"
      ]
    },
    "SlaInputContent": {
      "type": "object",
      "properties": {
        "slaInputConfiguration": {
          "$ref": "#/$defs/SlaInputConfiguration"
        }
      },
      "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."
    }
  }
}