1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00
bitwarden/src/Api/Models/Response/CipherHistoryResponseModel.cs
2017-02-18 01:17:09 -05:00

31 lines
923 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Bit.Core.Domains;
namespace Bit.Api.Models
{
public class CipherHistoryResponseModel : ResponseModel
{
public CipherHistoryResponseModel(IEnumerable<Cipher> revisedCiphers, IEnumerable<Guid> deletedIds, Guid userId)
: base("cipherHistory")
{
if(revisedCiphers == null)
{
throw new ArgumentNullException(nameof(revisedCiphers));
}
if(deletedIds == null)
{
throw new ArgumentNullException(nameof(deletedIds));
}
Revised = revisedCiphers.Select(c => new CipherResponseModel(c, userId));
Deleted = deletedIds.Select(id => id.ToString());
}
public IEnumerable<CipherResponseModel> Revised { get; set; }
public IEnumerable<string> Deleted { get; set; }
}
}