-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathReceiveFileModel.cs
More file actions
37 lines (28 loc) · 1.03 KB
/
ReceiveFileModel.cs
File metadata and controls
37 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Text.Json.Serialization;
using Bit.Core.Tools.Models.Data;
using Bit.Core.Utilities;
namespace Bit.Api.Tools.Models;
public class ReceiveFileModel
{
public ReceiveFileModel() { }
public ReceiveFileModel(ReceiveFileData data)
{
Id = data.Id;
FileName = data.FileName;
Size = data.Size;
SizeName = CoreHelpers.ReadableBytesSize(data.Size);
EncapsulatedFileContentEncryptionKey = data.EncapsulatedFileContentEncryptionKey;
Validated = data.Validated;
}
public string? Id { get; set; }
[EncryptedString]
[EncryptedStringLength(1000)]
public string FileName { get; set; } = string.Empty;
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
public long? Size { get; set; }
public string? SizeName { get; set; }
[EncryptedString]
[EncryptedStringLength(1000)]
public string EncapsulatedFileContentEncryptionKey { get; set; } = string.Empty;
public bool Validated { get; set; }
}