2021-11-27 02:10:56 +00:00
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
2021-09-30 01:51:38 +00:00
|
|
|
using SqlKata;
|
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
namespace PluralKit.Core;
|
2021-11-19 16:37:50 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public class AccountPatch: PatchObject
|
2020-11-20 23:34:08 +00:00
|
|
|
{
|
2022-01-22 07:47:47 +00:00
|
|
|
public Partial<ulong> DmChannel { get; set; }
|
2021-11-27 02:10:56 +00:00
|
|
|
public Partial<bool> AllowAutoproxy { get; set; }
|
2020-11-20 23:34:08 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
|
2022-01-22 07:47:47 +00:00
|
|
|
.With("dm_channel", DmChannel)
|
2021-11-27 02:10:56 +00:00
|
|
|
.With("allow_autoproxy", AllowAutoproxy)
|
|
|
|
);
|
2021-11-19 16:37:50 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public JObject ToJson()
|
|
|
|
{
|
|
|
|
var o = new JObject();
|
2021-11-19 16:37:50 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
if (AllowAutoproxy.IsPresent)
|
|
|
|
o.Add("allow_autoproxy", AllowAutoproxy.Value);
|
2021-11-19 16:37:50 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
return o;
|
2021-08-27 15:03:47 +00:00
|
|
|
}
|
|
|
|
}
|