run dotnet format
This commit is contained in:
		@@ -1,10 +1,10 @@
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
{
 | 
			
		||||
	public class AccountPatch: PatchObject
 | 
			
		||||
	{
 | 
			
		||||
		public Partial<bool> AllowAutoproxy { get; set; }
 | 
			
		||||
    public class AccountPatch: PatchObject
 | 
			
		||||
    {
 | 
			
		||||
        public Partial<bool> AllowAutoproxy { get; set; }
 | 
			
		||||
 | 
			
		||||
		public override UpdateQueryBuilder Apply(UpdateQueryBuilder b) => b
 | 
			
		||||
			.With("allow_autoproxy", AllowAutoproxy);
 | 
			
		||||
	}
 | 
			
		||||
} 
 | 
			
		||||
        public override UpdateQueryBuilder Apply(UpdateQueryBuilder b) => b
 | 
			
		||||
            .With("allow_autoproxy", AllowAutoproxy);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
#nullable enable
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
@@ -12,7 +12,7 @@ namespace PluralKit.Core
 | 
			
		||||
        public Partial<string?> Icon { get; set; }
 | 
			
		||||
        public Partial<string?> BannerImage { get; set; }
 | 
			
		||||
        public Partial<string?> Color { get; set; }
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        public Partial<PrivacyLevel> DescriptionPrivacy { get; set; }
 | 
			
		||||
        public Partial<PrivacyLevel> IconPrivacy { get; set; }
 | 
			
		||||
        public Partial<PrivacyLevel> ListPrivacy { get; set; }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
{
 | 
			
		||||
    public class GuildPatch: PatchObject
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
#nullable enable
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
{
 | 
			
		||||
    public class MemberGuildPatch: PatchObject
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
#nullable enable
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
 | 
			
		||||
@@ -83,9 +83,9 @@ namespace PluralKit.Core
 | 
			
		||||
        {
 | 
			
		||||
            var patch = new MemberPatch();
 | 
			
		||||
 | 
			
		||||
            if (o.ContainsKey("name") && o["name"].Type == JTokenType.Null) 
 | 
			
		||||
            if (o.ContainsKey("name") && o["name"].Type == JTokenType.Null)
 | 
			
		||||
                throw new ValidationError("Member name can not be set to null.");
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            if (o.ContainsKey("name")) patch.Name = o.Value<string>("name");
 | 
			
		||||
            if (o.ContainsKey("color")) patch.Color = o.Value<string>("color").NullIfEmpty()?.ToLower();
 | 
			
		||||
            if (o.ContainsKey("display_name")) patch.DisplayName = o.Value<string>("display_name").NullIfEmpty();
 | 
			
		||||
@@ -107,17 +107,17 @@ namespace PluralKit.Core
 | 
			
		||||
 | 
			
		||||
            // legacy: used in old export files and APIv1
 | 
			
		||||
            if (o.ContainsKey("prefix") || o.ContainsKey("suffix") && !o.ContainsKey("proxy_tags"))
 | 
			
		||||
                patch.ProxyTags = new[] {new ProxyTag(o.Value<string>("prefix"), o.Value<string>("suffix"))};
 | 
			
		||||
                patch.ProxyTags = new[] { new ProxyTag(o.Value<string>("prefix"), o.Value<string>("suffix")) };
 | 
			
		||||
            else if (o.ContainsKey("proxy_tags"))
 | 
			
		||||
                patch.ProxyTags = o.Value<JArray>("proxy_tags")
 | 
			
		||||
                    .OfType<JObject>().Select(o => new ProxyTag(o.Value<string>("prefix"), o.Value<string>("suffix")))
 | 
			
		||||
                    .Where(p => p.Valid)
 | 
			
		||||
                    .ToArray();
 | 
			
		||||
            
 | 
			
		||||
            if(o.ContainsKey("privacy")) //TODO: Deprecate this completely in api v2
 | 
			
		||||
 | 
			
		||||
            if (o.ContainsKey("privacy")) //TODO: Deprecate this completely in api v2
 | 
			
		||||
            {
 | 
			
		||||
                var plevel = o.ParsePrivacy("privacy");
 | 
			
		||||
                                
 | 
			
		||||
 | 
			
		||||
                patch.Visibility = plevel;
 | 
			
		||||
                patch.NamePrivacy = plevel;
 | 
			
		||||
                patch.AvatarPrivacy = plevel;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
@@ -7,7 +7,7 @@ namespace PluralKit.Core
 | 
			
		||||
    {
 | 
			
		||||
        public abstract UpdateQueryBuilder Apply(UpdateQueryBuilder b);
 | 
			
		||||
 | 
			
		||||
        public void AssertIsValid() {}
 | 
			
		||||
        public void AssertIsValid() { }
 | 
			
		||||
 | 
			
		||||
        protected bool AssertValid(string input, string name, int maxLength, Func<string, bool>? validate = null)
 | 
			
		||||
        {
 | 
			
		||||
@@ -28,7 +28,7 @@ namespace PluralKit.Core
 | 
			
		||||
 | 
			
		||||
    public class ValidationError: Exception
 | 
			
		||||
    {
 | 
			
		||||
        public ValidationError(string message): base(message) { }
 | 
			
		||||
        public ValidationError(string message) : base(message) { }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class FieldTooLongError: ValidationError
 | 
			
		||||
@@ -37,7 +37,7 @@ namespace PluralKit.Core
 | 
			
		||||
        public int MaxLength;
 | 
			
		||||
        public int ActualLength;
 | 
			
		||||
 | 
			
		||||
        public FieldTooLongError(string name, int maxLength, int actualLength):
 | 
			
		||||
        public FieldTooLongError(string name, int maxLength, int actualLength) :
 | 
			
		||||
            base($"{name} too long ({actualLength} > {maxLength})")
 | 
			
		||||
        {
 | 
			
		||||
            Name = name;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
#nullable enable
 | 
			
		||||
namespace PluralKit.Core
 | 
			
		||||
{
 | 
			
		||||
    public class SystemGuildPatch: PatchObject
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
#nullable enable
 | 
			
		||||
#nullable enable
 | 
			
		||||
using System;
 | 
			
		||||
using System.Text.RegularExpressions;
 | 
			
		||||
 | 
			
		||||
@@ -82,7 +82,7 @@ namespace PluralKit.Core
 | 
			
		||||
            // legacy: APIv1 uses "tz" instead of "timezone"
 | 
			
		||||
            // todo: remove in APIv2
 | 
			
		||||
            if (o.ContainsKey("tz")) patch.UiTz = o.Value<string>("tz") ?? "UTC";
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            if (o.ContainsKey("description_privacy")) patch.DescriptionPrivacy = o.ParsePrivacy("description_privacy");
 | 
			
		||||
            if (o.ContainsKey("member_list_privacy")) patch.MemberListPrivacy = o.ParsePrivacy("member_list_privacy");
 | 
			
		||||
            if (o.ContainsKey("front_privacy")) patch.FrontPrivacy = o.ParsePrivacy("front_privacy");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user