1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 05:28:15 -05:00
bitwarden/src/Api/Models/Request/SubvaultRequestModel.cs
2017-03-07 23:06:14 -05:00

36 lines
822 B
C#

using System;
using System.ComponentModel.DataAnnotations;
using Bit.Api.Utilities;
using Bit.Core.Domains;
using Newtonsoft.Json;
namespace Bit.Api.Models
{
public class SubvaultCreateRequestModel : SubvaultUpdateRequestModel
{
public string OrganizationId { get; set; }
public Subvault ToSubvault()
{
return ToSubvault(new Subvault
{
OrganizationId = new Guid(OrganizationId)
});
}
}
public class SubvaultUpdateRequestModel
{
[Required]
[EncryptedString]
[StringLength(300)]
public string Name { get; set; }
public Subvault ToSubvault(Subvault existingSubvault)
{
existingSubvault.Name = Name;
return existingSubvault;
}
}
}