2017-06-30 14:41:57 -04:00
|
|
|
|
using System;
|
2022-01-21 09:36:25 -05:00
|
|
|
|
using System.Text.Json.Serialization;
|
2017-06-30 11:15:58 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Data
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CipherAttachment
|
|
|
|
|
|
{
|
|
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
|
public Guid? UserId { get; set; }
|
|
|
|
|
|
public Guid? OrganizationId { get; set; }
|
|
|
|
|
|
public string AttachmentId { get; set; }
|
|
|
|
|
|
public string AttachmentData { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public class MetaData
|
|
|
|
|
|
{
|
2017-06-30 14:41:57 -04:00
|
|
|
|
private long _size;
|
|
|
|
|
|
|
2022-01-21 09:36:25 -05:00
|
|
|
|
// We serialize Size as a string since JSON (or Javascript) doesn't support full precision for long numbers
|
|
|
|
|
|
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
2017-06-30 14:41:57 -04:00
|
|
|
|
public long Size
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _size; }
|
|
|
|
|
|
set { _size = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-06-30 11:15:58 -04:00
|
|
|
|
public string FileName { get; set; }
|
2018-11-14 17:19:04 -05:00
|
|
|
|
public string Key { get; set; }
|
2021-02-22 15:35:16 -06:00
|
|
|
|
|
|
|
|
|
|
public string ContainerName { get; set; } = "attachments";
|
2021-03-30 18:41:14 -05:00
|
|
|
|
public bool Validated { get; set; } = true;
|
2021-02-22 15:35:16 -06:00
|
|
|
|
|
|
|
|
|
|
// This is stored alongside metadata as an identifier. It does not need repeating in serialization
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public string AttachmentId { get; set; }
|
2017-06-30 11:15:58 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|