/// <summary> /// Fetches the list of transactions made by the logged in user. Only successful transactions /// show here. /// </summary> /// <returns>Promise resolved when the operation has completed. The attached value describes a list of purchase /// transactions, without pagination functionality.</returns> public Promise<NonpagedList<PurchaseTransaction>> GetPurchaseHistory() { return Common.RunInTask<NonpagedList<PurchaseTransaction>>(Gamer.MakeHttpRequest("/v1/gamer/store/purchaseHistory"), (response, task) => { var products = new NonpagedList<PurchaseTransaction>(response.BodyJson); foreach (Bundle b in response.BodyJson["purchases"].AsArray()) { products.Add(new PurchaseTransaction(b)); } task.PostResult(products); }); }
/// <summary>This method can be used to retrieve the gamer who have added you as a godfather.</summary> /// <returns>Promise resolved when the operation has completed.</returns> public Promise<NonpagedList<GamerInfo>> GetGodchildren() { UrlBuilder url = new UrlBuilder("/v2.6/gamer/godchildren").Path(domain); HttpRequest req = Gamer.MakeHttpRequest(url); return Common.RunInTask<NonpagedList<GamerInfo>>(req, (response, task) => { var result = new NonpagedList<GamerInfo>(response.BodyJson); foreach (Bundle b in response.BodyJson["godchildren"].AsArray()) { result.Add(new GamerInfo(b)); } task.PostResult(result); }); }
/// <summary>Method used to retrieve the application's friends of the currently logged in profile.</summary> /// <returns>Promise resolved when the operation has completed, with the fetched list of friends.</returns> /// <param name="filterBlacklisted">When set to true, restricts to blacklisted friends.</param> public Promise<NonpagedList<GamerInfo>> ListFriends(bool filterBlacklisted = false) { UrlBuilder url = new UrlBuilder("/v2.6/gamer/friends").Path(domain); if (filterBlacklisted) url.QueryParam("status", "blacklist"); HttpRequest req = Gamer.MakeHttpRequest(url); return Common.RunInTask<NonpagedList<GamerInfo>>(req, (response, task) => { var result = new NonpagedList<GamerInfo>(response.BodyJson); foreach (Bundle f in response.BodyJson["friends"].AsArray()) { result.Add(new GamerInfo(f)); } task.PostResult(result); }); }
/// <summary>Fetch the score list for a given board, restricting to the scores made by the friends of the current user.</summary> /// <returns>Promise resolved when the operation has completed. The attached value describes a list of scores, /// without pagination functionality.</returns> /// <param name="board">The name of the board to fetch scores from.</param> public Promise<NonpagedList<Score>> ListFriendScores(string board) { UrlBuilder url = new UrlBuilder("/v2.6/gamer/scores").Path(domain).Path(board).QueryParam("type", "friendscore"); return Common.RunInTask<NonpagedList<Score>>(Gamer.MakeHttpRequest(url), (response, task) => { var scores = new NonpagedList<Score>(response.BodyJson); foreach (Bundle b in response.BodyJson[board].AsArray()) { scores.Add(new Score(b)); } task.PostResult(scores); }); }