2022-04-26 17:21:17 +02:00
|
|
|
|
using System.Collections.Generic;
|
2019-04-15 14:42:50 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2022-04-26 17:21:17 +02:00
|
|
|
|
using Bit.Core.Models.Data;
|
|
|
|
|
using Bit.Core.Models.View;
|
2019-04-15 14:42:50 +02:00
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Domain
|
|
|
|
|
{
|
|
|
|
|
public class Collection : Domain
|
|
|
|
|
{
|
|
|
|
|
public Collection() { }
|
|
|
|
|
|
|
|
|
|
public Collection(CollectionData obj, bool alreadyEncrypted = false)
|
|
|
|
|
{
|
|
|
|
|
BuildDomainModel(this, obj, new HashSet<string>
|
|
|
|
|
{
|
|
|
|
|
"Id",
|
|
|
|
|
"OrganizationId",
|
|
|
|
|
"Name",
|
|
|
|
|
"ExternalId",
|
|
|
|
|
"ReadOnly"
|
|
|
|
|
}, alreadyEncrypted, new HashSet<string>
|
|
|
|
|
{
|
|
|
|
|
"Id",
|
|
|
|
|
"OrganizationId",
|
|
|
|
|
"ExternalId",
|
|
|
|
|
"ReadOnly"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public string OrganizationId { get; set; }
|
2021-04-21 22:27:14 +02:00
|
|
|
|
public EncString Name { get; set; }
|
2019-04-15 14:42:50 +02:00
|
|
|
|
public string ExternalId { get; set; }
|
|
|
|
|
public bool ReadOnly { get; set; }
|
|
|
|
|
|
2019-04-17 15:07:51 +02:00
|
|
|
|
public Task<CollectionView> DecryptAsync()
|
2019-04-15 14:42:50 +02:00
|
|
|
|
{
|
2019-04-17 15:07:51 +02:00
|
|
|
|
return DecryptObjAsync(new CollectionView(this), this, new HashSet<string> { "Name" }, OrganizationId);
|
2019-04-15 14:42:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|