feat(bot): add proxy error config (#544)

This commit is contained in:
Jake Fulmine 2023-03-25 23:42:47 +01:00 committed by GitHub
parent 020a6f99fe
commit 8187aa05b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 93 additions and 7 deletions

View file

@ -18,6 +18,7 @@ public class SystemConfigPatch: PatchObject
public Partial<int?> GroupLimitOverride { get; set; }
public Partial<string[]> DescriptionTemplates { get; set; }
public Partial<bool> CaseSensitiveProxyTags { get; set; }
public Partial<bool> ProxyErrorMessageEnabled { get; set; }
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
@ -31,6 +32,7 @@ public class SystemConfigPatch: PatchObject
.With("group_limit_override", GroupLimitOverride)
.With("description_templates", DescriptionTemplates)
.With("case_sensitive_proxy_tags", CaseSensitiveProxyTags)
.With("proxy_error_message_enabled", ProxyErrorMessageEnabled)
);
public new void AssertIsValid()
@ -83,6 +85,9 @@ public class SystemConfigPatch: PatchObject
if (CaseSensitiveProxyTags.IsPresent)
o.Add("case_sensitive_proxy_tags", CaseSensitiveProxyTags.Value);
if (ProxyErrorMessageEnabled.IsPresent)
o.Add("proxy_error_message_enabled", ProxyErrorMessageEnabled.Value);
return o;
}
@ -111,6 +116,9 @@ public class SystemConfigPatch: PatchObject
if (o.ContainsKey("case_sensitive_proxy_tags"))
patch.CaseSensitiveProxyTags = o.Value<bool>("case_sensitive_proxy_tags");
if (o.ContainsKey("proxy_error_message_enabled"))
patch.ProxyErrorMessageEnabled = o.Value<bool>("proxy_error_message_enabled");
return patch;
}
}