Files
server/src/Core/Models/Api/Request/SubvaultRequestModel.cs

31 lines
681 B
C#
Raw Normal View History

2017-03-07 23:06:14 -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;
2017-03-07 23:06:14 -05:00
using Newtonsoft.Json;
2017-03-08 21:55:08 -05:00
namespace Bit.Core.Models.Api
2017-03-07 23:06:14 -05:00
{
2017-03-09 22:09:09 -05:00
public class SubvaultRequestModel
2017-03-07 23:06:14 -05:00
{
2017-03-09 22:09:09 -05:00
[Required]
[EncryptedString]
[StringLength(300)]
public string Name { get; set; }
2017-03-07 23:06:14 -05:00
2017-03-09 22:09:09 -05:00
public Subvault ToSubvault(Guid orgId)
2017-03-07 23:06:14 -05:00
{
return ToSubvault(new Subvault
{
2017-03-09 22:09:09 -05:00
OrganizationId = orgId
2017-03-07 23:06:14 -05:00
});
}
public Subvault ToSubvault(Subvault existingSubvault)
{
existingSubvault.Name = Name;
return existingSubvault;
}
}
}