mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 06:17:55 +00:00
[WIP] feat: scoped api keys
This commit is contained in:
parent
e7ee593a85
commit
06cb160f95
45 changed files with 1264 additions and 154 deletions
24
PluralKit.Core/Models/Patch/ApiKeyPatch.cs
Normal file
24
PluralKit.Core/Models/Patch/ApiKeyPatch.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using SqlKata;
|
||||
|
||||
namespace PluralKit.Core;
|
||||
|
||||
public class ApiKeyPatch: PatchObject
|
||||
{
|
||||
public Partial<string> Name { get; set; }
|
||||
|
||||
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
|
||||
.With("name", Name)
|
||||
);
|
||||
|
||||
public JObject ToJson()
|
||||
{
|
||||
var o = new JObject();
|
||||
|
||||
if (Name.IsPresent)
|
||||
o.Add("name", Name.Value);
|
||||
|
||||
return o;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue