mirror of
https://github.com/bitwarden/server.git
synced 2026-02-05 00:23:24 +08:00
36 lines
827 B
C#
36 lines
827 B
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Bit.Api.Utilities;
|
|
using Bit.Core.Models.Table;
|
|
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;
|
|
}
|
|
}
|
|
}
|