mirror of
https://github.com/bitwarden/server.git
synced 2025-04-13 17:18:14 -05:00
33 lines
840 B
C#
33 lines
840 B
C#
using System;
|
|
using Bit.Core.Models.Table;
|
|
|
|
namespace Bit.Core.Models.Api
|
|
{
|
|
public class FolderResponseModel : ResponseModel
|
|
{
|
|
public FolderResponseModel(Cipher cipher, Guid userId)
|
|
: base("folder")
|
|
{
|
|
if(cipher == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(cipher));
|
|
}
|
|
|
|
if(cipher.Type != Core.Enums.CipherType.Folder)
|
|
{
|
|
throw new ArgumentException(nameof(cipher.Type));
|
|
}
|
|
|
|
var data = new FolderDataModel(cipher);
|
|
|
|
Id = cipher.Id.ToString();
|
|
Name = data.Name;
|
|
RevisionDate = cipher.RevisionDate;
|
|
}
|
|
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public DateTime RevisionDate { get; set; }
|
|
}
|
|
}
|