2016-05-02 09:52:09 +03:00
|
|
|
|
using Bit.App.Models.Data;
|
|
|
|
|
using Bit.App.Models.Api;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Models
|
|
|
|
|
{
|
2017-07-12 22:16:36 +03:00
|
|
|
|
public class Folder
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
|
|
|
|
public Folder()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
public Folder(FolderData data)
|
|
|
|
|
{
|
|
|
|
|
Id = data.Id;
|
|
|
|
|
Name = data.Name != null ? new CipherString(data.Name) : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Folder(FolderResponse response)
|
|
|
|
|
{
|
2016-05-03 09:08:50 +03:00
|
|
|
|
Id = response.Id;
|
2016-05-02 09:52:09 +03:00
|
|
|
|
Name = response.Name != null ? new CipherString(response.Name) : null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-12 22:16:36 +03:00
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public CipherString Name { get; set; }
|
|
|
|
|
|
2016-05-03 09:08:50 +03:00
|
|
|
|
public FolderRequest ToFolderRequest()
|
|
|
|
|
{
|
|
|
|
|
return new FolderRequest(this);
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-03 00:50:16 +03:00
|
|
|
|
public FolderData ToFolderData(string userId)
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
2016-05-03 00:50:16 +03:00
|
|
|
|
return new FolderData(this, userId);
|
2016-05-02 09:52:09 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|