mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-12-23 05:17:22 -05:00
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
31 lines
658 B
C#
31 lines
658 B
C#
using API.Entities;
|
|
using API.Entities.Enums.Device;
|
|
|
|
namespace API.Helpers.Builders;
|
|
|
|
public class DeviceBuilder : IEntityBuilder<Device>
|
|
{
|
|
private readonly Device _device;
|
|
public Device Build() => _device;
|
|
|
|
public DeviceBuilder(string name)
|
|
{
|
|
_device = new Device()
|
|
{
|
|
Name = name,
|
|
Platform = EmailDevicePlatform.Custom
|
|
};
|
|
}
|
|
|
|
public DeviceBuilder WithPlatform(EmailDevicePlatform platform)
|
|
{
|
|
_device.Platform = platform;
|
|
return this;
|
|
}
|
|
public DeviceBuilder WithEmail(string email)
|
|
{
|
|
_device.EmailAddress = email;
|
|
return this;
|
|
}
|
|
}
|