public static T Parse <T>(string json, PixeeSharpBaseApi client, IContractResolver contractResolver = null) where T : IPixivModel { var res = JsonConvert.DeserializeObject <T>(json, new JsonSerializerSettings() { ContractResolver = contractResolver ?? new PixivContractResolver() }); res.Client = client; return(res); }
public static PixivResult <T> Parse(string json, string resultName = null, PixeeSharpBaseApi client = null) { var result = Parse <PixivResult <T> >(json, client, new PixivContractResolver(resultName)); if (client != null) { foreach (var r in result.Result) { r.Client = client; } } result.ResultName = resultName; return(result); }
public static PixivRecommentIllustrationResult Parse(string json, PixeeSharpBaseApi client) { var result = Parse <PixivRecommentIllustrationResult>(json, client); if (client != null) { foreach (var illust in result.RankingIllustrations ?? Enumerable.Empty <PixivIllustration>()) { illust.Client = client; } } return(result); }
public static PixivTrendingTags Parse(string json, PixeeSharpBaseApi client = null) { Dictionary <string, string> map = new Dictionary <string, string> { { "Name", "tag" } }; PixivContractResolver resolver = new PixivContractResolver(map); var res = Parse <PixivTrendingTags>(json, client, resolver); foreach (var t in res.TrendingTags) { t.Client = client; t.Illustration.Client = client; } return(res); }
public static PixivUserProfile Parse(string json, PixeeSharpBaseApi client = null) => Parse <PixivUserProfile>(json, client);
public PixeeSharpAppApi(PixeeSharpBaseApi BaseAPI) : base(BaseAPI) { }