Apex
...
Types
Input & Output Types

Types.CreateAttachmentInput

Represents input for creating attachments using Create Attachments function. Following contuctors are supported -

Apex

  1. resourceId - Id of the file/folder in external storage, for which we're creating the attachment
  2. resourceType - One of file or folder
  3. parentId - Salesforce Id of the record for which we're creating the attachment
  4. driveId - Only applicable for SharePoint or Google Drive libraries. Supply null for other libraries. You can get this value from Content Library