2017-07-12 22:16:36 +03:00
|
|
|
|
using Bit.App.Models.Api;
|
|
|
|
|
using Bit.App.Models.Data;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Models
|
|
|
|
|
{
|
|
|
|
|
public class Attachment
|
|
|
|
|
{
|
|
|
|
|
public Attachment()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
public Attachment(AttachmentData data)
|
|
|
|
|
{
|
|
|
|
|
Id = data.Id;
|
|
|
|
|
Url = data.Url;
|
2017-07-12 23:23:24 +03:00
|
|
|
|
FileName = data.FileName != null ? new CipherString(data.FileName) : null;
|
2017-07-12 22:16:36 +03:00
|
|
|
|
Size = data.Size;
|
|
|
|
|
SizeName = data.SizeName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Attachment(AttachmentResponse response)
|
|
|
|
|
{
|
|
|
|
|
Id = response.Id;
|
|
|
|
|
Url = response.Url;
|
2017-07-12 23:23:24 +03:00
|
|
|
|
FileName = response.FileName != null ? new CipherString(response.FileName) : null;
|
2017-07-12 22:16:36 +03:00
|
|
|
|
Size = response.Size;
|
|
|
|
|
SizeName = response.SizeName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public string Url { get; set; }
|
2017-07-12 23:23:24 +03:00
|
|
|
|
public CipherString FileName { get; set; }
|
2017-07-12 22:16:36 +03:00
|
|
|
|
public string Size { get; set; }
|
|
|
|
|
public string SizeName { get; set; }
|
|
|
|
|
|
|
|
|
|
public AttachmentData ToAttachmentData(string loginId)
|
|
|
|
|
{
|
|
|
|
|
return new AttachmentData(this, loginId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|