2015-12-08 22:57:38 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2017-03-08 21:55:08 -05:00
|
|
|
|
using Bit.Core.Utilities;
|
2017-03-08 21:45:08 -05:00
|
|
|
|
using Bit.Core.Models.Table;
|
2016-05-21 17:16:22 -04:00
|
|
|
|
using Newtonsoft.Json;
|
2015-12-08 22:57:38 -05:00
|
|
|
|
|
2017-03-08 21:55:08 -05:00
|
|
|
|
namespace Bit.Core.Models.Api
|
2015-12-08 22:57:38 -05:00
|
|
|
|
{
|
|
|
|
|
|
public class FolderRequestModel
|
|
|
|
|
|
{
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
[EncryptedString]
|
2018-08-02 08:57:32 -04:00
|
|
|
|
[EncryptedStringLength(1000)]
|
2015-12-08 22:57:38 -05:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
2017-03-18 11:35:41 -04:00
|
|
|
|
public Folder ToFolder(Guid userId)
|
2015-12-08 22:57:38 -05:00
|
|
|
|
{
|
2017-03-18 11:35:41 -04:00
|
|
|
|
return ToFolder(new Folder
|
2015-12-08 22:57:38 -05:00
|
|
|
|
{
|
2017-01-24 22:46:54 -05:00
|
|
|
|
UserId = userId
|
2016-06-08 22:00:31 -04:00
|
|
|
|
});
|
2015-12-08 22:57:38 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-03-18 11:35:41 -04:00
|
|
|
|
public Folder ToFolder(Folder existingFolder)
|
2015-12-08 22:57:38 -05:00
|
|
|
|
{
|
2017-03-18 11:35:41 -04:00
|
|
|
|
existingFolder.Name = Name;
|
2015-12-08 22:57:38 -05:00
|
|
|
|
return existingFolder;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-04-17 14:53:07 -04:00
|
|
|
|
|
|
|
|
|
|
public class FolderWithIdRequestModel : FolderRequestModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
|
}
|
2015-12-08 22:57:38 -05:00
|
|
|
|
}
|