2021-12-14 15:05:07 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-01-11 10:40:51 +01:00
|
|
|
|
using Bit.Core.Entities;
|
2021-12-14 15:05:07 +00:00
|
|
|
|
using Bit.Core.Utilities;
|
2017-08-15 16:31:19 -04:00
|
|
|
|
|
2021-12-14 15:05:07 +00:00
|
|
|
|
namespace Bit.Api.Models.Request;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2017-08-15 16:31:19 -04:00
|
|
|
|
public class InstallationRequestModel
|
|
|
|
|
|
{
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
[EmailAddress]
|
2021-03-25 19:21:23 +01:00
|
|
|
|
[StringLength(256)]
|
2017-08-15 16:31:19 -04:00
|
|
|
|
public string Email { get; set; }
|
2022-08-29 15:53:48 -04:00
|
|
|
|
|
2017-08-15 16:31:19 -04:00
|
|
|
|
public Installation ToInstallation()
|
2022-08-29 16:06:55 -04:00
|
|
|
|
{
|
2017-08-15 16:31:19 -04:00
|
|
|
|
return new Installation
|
|
|
|
|
|
{
|
2021-12-14 15:05:07 +00:00
|
|
|
|
Key = CoreHelpers.SecureRandomString(20),
|
2017-08-15 16:31:19 -04:00
|
|
|
|
Email = Email,
|
|
|
|
|
|
Enabled = true
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|