bitwarden-android/src/Core/Models/Domain/LoginUri.cs

44 lines
1.1 KiB
C#
Raw Normal View History

2019-04-12 17:06:47 +03:00
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Models.View;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Bit.Core.Models.Domain
{
public class LoginUri : Domain
{
public LoginUri() { }
public LoginUri(LoginUriData obj, bool alreadyEncrypted = false)
{
Match = obj.Match;
BuildDomainModel(this, obj, new HashSet<string>
{
"Uri"
}, alreadyEncrypted);
}
public CipherString Uri { get; set; }
public UriMatchType? Match { get; set; }
public Task<LoginUriView> DecryptAsync(string orgId)
{
return DecryptObjAsync(new LoginUriView(this), this, new HashSet<string>
{
"Uri"
}, orgId);
}
public LoginUriData ToLoginUriData()
{
var u = new LoginUriData();
BuildDataModel(this, u, new HashSet<string>
{
"Uri"
}, new HashSet<string> { "Match" });
return u;
}
}
}