mirror of
https://github.com/bitwarden/mobile
synced 2025-12-26 13:13:28 +00:00
add collection syncing
This commit is contained in:
36
src/App/Models/Data/CollectionData.cs
Normal file
36
src/App/Models/Data/CollectionData.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using SQLite;
|
||||
using Bit.App.Abstractions;
|
||||
using Bit.App.Models.Api;
|
||||
|
||||
namespace Bit.App.Models.Data
|
||||
{
|
||||
[Table("Collection")]
|
||||
public class CollectionData : IDataObject<string>
|
||||
{
|
||||
public CollectionData()
|
||||
{ }
|
||||
|
||||
public CollectionData(Collection collection, string userId)
|
||||
{
|
||||
Id = collection.Id;
|
||||
UserId = userId;
|
||||
Name = collection.Name?.EncryptedString;
|
||||
OrganizationId = collection.OrganizationId;
|
||||
}
|
||||
|
||||
public CollectionData(CollectionResponse collection, string userId)
|
||||
{
|
||||
Id = collection.Id;
|
||||
UserId = userId;
|
||||
Name = collection.Name;
|
||||
OrganizationId = collection.OrganizationId;
|
||||
}
|
||||
|
||||
[PrimaryKey]
|
||||
public string Id { get; set; }
|
||||
[Indexed]
|
||||
public string UserId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string OrganizationId { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user