mirror of
https://github.com/bitwarden/server.git
synced 2025-04-29 00:32:18 -05:00
33 lines
865 B
C#
33 lines
865 B
C#
using Bit.Core.Entities;
|
|
using Bit.Core.Models.Api;
|
|
|
|
namespace Bit.Api.Models.Response;
|
|
|
|
public class ApiKeyResponseModel : ResponseModel
|
|
{
|
|
public ApiKeyResponseModel(OrganizationApiKey organizationApiKey, string obj = "apiKey")
|
|
: base(obj)
|
|
{
|
|
if (organizationApiKey == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(organizationApiKey));
|
|
}
|
|
ApiKey = organizationApiKey.ApiKey;
|
|
RevisionDate = organizationApiKey.RevisionDate;
|
|
}
|
|
|
|
public ApiKeyResponseModel(User user, string obj = "apiKey")
|
|
: base(obj)
|
|
{
|
|
if (user == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(user));
|
|
}
|
|
ApiKey = user.ApiKey;
|
|
RevisionDate = user.RevisionDate;
|
|
}
|
|
|
|
public string ApiKey { get; set; }
|
|
public DateTime RevisionDate { get; set; }
|
|
}
|