-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VNDB API HTTPS Changes: LogIn and ChangeVote
- Loading branch information
Showing
10 changed files
with
843 additions
and
714 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// ReSharper disable once CheckNamespace | ||
namespace Happy_Apps_Core.API_Objects; | ||
|
||
public struct AuthInfo | ||
{ | ||
public string Id { get; set; } | ||
public string UserName { get; set; } | ||
public string[] Permissions { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Runtime.Serialization; | ||
using Newtonsoft.Json; | ||
|
||
namespace Happy_Apps_Core.API_Objects; | ||
|
||
public struct UList | ||
{ | ||
private static JsonSerializerSettings _serializerSettings = new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }; | ||
public string User { get; set; } | ||
public string Fields { get; set; } | ||
public object[] Filters { get; set; } | ||
public string Sort { get; set; } | ||
public bool Reverse { get; set; } | ||
public int Results { get; set; } | ||
|
||
public string GetAsJson() | ||
{ | ||
return JsonConvert.SerializeObject(this, _serializerSettings); | ||
} | ||
} | ||
|
||
public struct UListPatch | ||
{ | ||
private static JsonSerializerSettings _serializerSettings = new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }; | ||
|
||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] | ||
public int[] Labels_Unset { get; set; } | ||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] | ||
public int[] Labels_Set { get; set; } | ||
[JsonProperty(NullValueHandling = NullValueHandling.Include, PropertyName = "vote")] | ||
public int? Vote { get; set; } | ||
|
||
|
||
public string GetAsJson(bool includeVote) | ||
{ | ||
//use JsonProperty values if we want to include vote when null (for removing vote), else, ignore all null values. | ||
return JsonConvert.SerializeObject(this, includeVote ? null :_serializerSettings); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.