mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-10 09:49:52 +01:00
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
|
using System;
|
||
|
using Bit.Core.Enums;
|
||
|
using Bit.Core.Models.Response;
|
||
|
|
||
|
namespace Bit.Core.Models.Data
|
||
|
{
|
||
|
public class SendData : Data
|
||
|
{
|
||
|
public SendData() { }
|
||
|
|
||
|
public SendData(SendResponse response, string userId)
|
||
|
{
|
||
|
Id = response.Id;
|
||
|
AccessId = response.AccessId;
|
||
|
UserId = userId;
|
||
|
Type = response.Type;
|
||
|
Name = response.Name;
|
||
|
Notes = response.Notes;
|
||
|
Key = response.Key;
|
||
|
MaxAccessCount = response.MaxAccessCount;
|
||
|
AccessCount = response.AccessCount;
|
||
|
RevisionDate = response.RevisionDate;
|
||
|
ExpirationDate = response.ExpirationDate;
|
||
|
DeletionDate = response.DeletionDate;
|
||
|
Password = response.Password;
|
||
|
Disabled = response.Disabled;
|
||
|
|
||
|
switch (Type)
|
||
|
{
|
||
|
case SendType.File:
|
||
|
File = new SendFileData(response.File);
|
||
|
break;
|
||
|
case SendType.Text:
|
||
|
Text = new SendTextData(response.Text);
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public string Id { get; set; }
|
||
|
public string AccessId { get; set; }
|
||
|
public string UserId { get; set; }
|
||
|
public SendType Type { get; set; }
|
||
|
public string Name { get; set; }
|
||
|
public string Notes { get; set; }
|
||
|
public SendFileData File { get; set; }
|
||
|
public SendTextData Text { get; set; }
|
||
|
public string Key { get; set; }
|
||
|
public int? MaxAccessCount { get; set; }
|
||
|
public int AccessCount { get; set; }
|
||
|
public DateTime RevisionDate { get; set; }
|
||
|
public DateTime? ExpirationDate { get; set; }
|
||
|
public DateTime DeletionDate { get; set; }
|
||
|
public string Password { get; set; }
|
||
|
public bool Disabled { get; set; }
|
||
|
}
|
||
|
}
|