setAttachmentTo method

Future<DecryptedDocumentDto?> setAttachmentTo(
  1. UserDto user,
  2. String documentId,
  3. ByteStream attachment,
  4. String? docEncKeys,
  5. CryptoConfig<DecryptedDocumentDto, DocumentDto> config,
)

Implementation

Future<DecryptedDocumentDto?> setAttachmentTo(UserDto user, String documentId, ByteStream attachment, String? docEncKeys, CryptoConfig<DecryptedDocumentDto, DocumentDto> config) async {
  return await (await this.rawSetDocumentAttachment(documentId, attachment, enckeys: docEncKeys))?.let((it) => config.decryptDocument(user.dataOwnerId()!, it));
}