1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-25 06:42:22 -05:00
bitwarden/src/Api/Models/CipherFieldModel.cs
2022-08-29 16:06:55 -04:00

37 lines
817 B
C#

using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
namespace Bit.Api.Models;
public class CipherFieldModel
{
public CipherFieldModel() { }
public CipherFieldModel(CipherFieldData data)
{
Type = data.Type;
Name = data.Name;
Value = data.Value;
LinkedId = data.LinkedId ?? null;
}
public FieldType Type { get; set; }
[EncryptedStringLength(1000)]
public string Name { get; set; }
[EncryptedStringLength(5000)]
public string Value { get; set; }
public int? LinkedId { get; set; }
public CipherFieldData ToCipherFieldData()
{
return new CipherFieldData
{
Type = Type,
Name = Name,
Value = Value,
LinkedId = LinkedId ?? null,
};
}
}