1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-24 14:26:38 -05:00
bitwarden/src/Core/Models/Api/Request/FolderRequestModel.cs
Kyle Spearrin 7cda459127 support for attachments keys
load existing items and set attachments on key update
2018-11-14 17:19:04 -05:00

36 lines
776 B
C#

using System;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
namespace Bit.Core.Models.Api
{
public class FolderRequestModel
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }
public Folder ToFolder(Guid userId)
{
return ToFolder(new Folder
{
UserId = userId
});
}
public Folder ToFolder(Folder existingFolder)
{
existingFolder.Name = Name;
return existingFolder;
}
}
public class FolderWithIdRequestModel : FolderRequestModel
{
public Guid Id { get; set; }
}
}