1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-26 10:36:21 +02:00
bitwarden-mobile/src/Core/Models/Domain/Collection.cs

42 lines
1.1 KiB
C#
Raw Normal View History

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; }
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
}
}
}