PluralKit/PluralKit.Core/Models/Patch/AccountPatch.cs

25 lines
549 B
C#
Raw Normal View History

using SqlKata;
using Newtonsoft.Json.Linq;
2020-11-20 23:34:08 +00:00
namespace PluralKit.Core
{
2021-08-27 15:03:47 +00:00
public class AccountPatch: PatchObject
{
public Partial<bool> AllowAutoproxy { get; set; }
2020-11-20 23:34:08 +00:00
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
.With("allow_autoproxy", AllowAutoproxy)
);
public JObject ToJson()
{
var o = new JObject();
if (AllowAutoproxy.IsPresent)
o.Add("allow_autoproxy", AllowAutoproxy.Value);
return o;
}
2021-08-27 15:03:47 +00:00
}
}