Esempio n. 1
0
 public AttachmentResponseModel(AttachmentResponseData data) : base("attachment")
 {
     Id       = data.Id;
     Url      = data.Url;
     FileName = data.Data.FileName;
     Key      = data.Data.Key;
     Size     = data.Data.Size;
     SizeName = CoreHelpers.ReadableBytesSize(data.Data.Size);
 }
Esempio n. 2
0
        public async Task <AttachmentResponseData> GetAttachmentDownloadDataAsync(Cipher cipher, string attachmentId)
        {
            var attachments = cipher?.GetAttachments() ?? new Dictionary <string, CipherAttachment.MetaData>();

            if (!attachments.ContainsKey(attachmentId))
            {
                throw new NotFoundException();
            }

            var data     = attachments[attachmentId];
            var response = new AttachmentResponseData
            {
                Cipher = cipher,
                Data   = data,
                Id     = attachmentId,
                Url    = await _attachmentStorageService.GetAttachmentDownloadUrlAsync(cipher, data),
            };

            return(response);
        }
 /// <summary>
 /// Called upon receiving an Attachment Responsefrom the GDS.
 /// </summary>
 /// <param name="header">The received header</param>
 /// <param name="data">The received attachment response</param>
 public virtual void OnAttachmentResponse6(MessageHeader header, AttachmentResponseData data)
 {
     throw new NotImplementedException();
 }