|
| 1 | +using Newtonsoft.Json; |
| 2 | +using System; |
| 3 | +using System.Collections; |
| 4 | +using System.Collections.Generic; |
| 5 | +using UnityEngine; |
| 6 | +using LootLocker; |
| 7 | +using LootLocker.Requests; |
| 8 | +using LootLocker.LootLockerEnums; |
| 9 | + |
| 10 | + |
| 11 | +namespace LootLocker.Requests |
| 12 | +{ |
| 13 | + public class LootLockerReportsGetTypesResponse : LootLockerResponse |
| 14 | + { |
| 15 | + // we are doing thisfor legacy reasons, since it is no longer being set on the backend |
| 16 | + public int id { get; set; } |
| 17 | + public string text { get; set; } |
| 18 | + } |
| 19 | + |
| 20 | + public class LootLockerReportsCreatePlayerResponse : LootLockerResponse |
| 21 | + { |
| 22 | + // we are doing thisfor legacy reasons, since it is no longer being set on the backend |
| 23 | + public int id { get; set; } |
| 24 | + public string text { get; set; } |
| 25 | + } |
| 26 | + |
| 27 | + public class ReportsCreatePlayerRequest |
| 28 | + { |
| 29 | + public int[] report_types { get; set; } |
| 30 | + public string text { get; set; } |
| 31 | + public int player_id { get; set; } |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +namespace LootLocker |
| 36 | +{ |
| 37 | + public partial class LootLockerAPIManager |
| 38 | + { |
| 39 | + public static void ReportsGetTypes(Action<LootLockerReportsGetTypesResponse> onComplete) |
| 40 | + { |
| 41 | + EndPointClass endPoint = LootLockerEndPoints.reportsGetTypes; |
| 42 | + LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, null, ((serverResponse) => |
| 43 | + { |
| 44 | + LootLockerReportsGetTypesResponse response = new LootLockerReportsGetTypesResponse(); |
| 45 | + if (string.IsNullOrEmpty(serverResponse.Error)) |
| 46 | + { |
| 47 | + response = JsonConvert.DeserializeObject<LootLockerReportsGetTypesResponse>(serverResponse.text); |
| 48 | + } |
| 49 | + |
| 50 | + response.text = serverResponse.text; |
| 51 | + response.success = serverResponse.success; |
| 52 | + response.Error = serverResponse.Error; response.statusCode = serverResponse.statusCode; |
| 53 | + onComplete?.Invoke(response); |
| 54 | + }), true, LootLockerCallerRole.User); |
| 55 | + } |
| 56 | + |
| 57 | + public static void ReportsGetRemovedUGCForPlayer(Action<LootLockerReportsGetTypesResponse> onComplete) |
| 58 | + { |
| 59 | + EndPointClass endPoint = LootLockerEndPoints.reportsGetRemovedUGCForPlayer; |
| 60 | + LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, null, ((serverResponse) => |
| 61 | + { |
| 62 | + LootLockerReportsGetTypesResponse response = new LootLockerReportsGetTypesResponse(); |
| 63 | + if (string.IsNullOrEmpty(serverResponse.Error)) |
| 64 | + { |
| 65 | + response = JsonConvert.DeserializeObject<LootLockerReportsGetTypesResponse>(serverResponse.text); |
| 66 | + } |
| 67 | + |
| 68 | + response.text = serverResponse.text; |
| 69 | + response.success = serverResponse.success; |
| 70 | + response.Error = serverResponse.Error; response.statusCode = serverResponse.statusCode; |
| 71 | + onComplete?.Invoke(response); |
| 72 | + }), true, LootLockerCallerRole.User); |
| 73 | + } |
| 74 | + |
| 75 | + public static void ReportsCreatePlayer(LootLockerGetByListMembersRequest data, string id, Action<LootLockerReportsCreatePlayerResponse> onComplete) |
| 76 | + { |
| 77 | + EndPointClass requestEndPoint = LootLockerEndPoints.reportsCreatePlayer; |
| 78 | + string json = ""; |
| 79 | + if (data == null) return; |
| 80 | + else json = JsonConvert.SerializeObject(data); |
| 81 | + |
| 82 | + string endPoint = string.Format(requestEndPoint.endPoint, id); |
| 83 | + |
| 84 | + LootLockerServerRequest.CallAPI(endPoint, requestEndPoint.httpMethod, json, ((serverResponse) => |
| 85 | + { |
| 86 | + LootLockerReportsCreatePlayerResponse response = new LootLockerReportsCreatePlayerResponse(); |
| 87 | + if (string.IsNullOrEmpty(serverResponse.Error)) { |
| 88 | + response = JsonConvert.DeserializeObject<LootLockerReportsCreatePlayerResponse>(serverResponse.text); |
| 89 | + } |
| 90 | + |
| 91 | + response.text = serverResponse.text; |
| 92 | + response.success = serverResponse.success; |
| 93 | + response.Error = serverResponse.Error; response.statusCode = serverResponse.statusCode; |
| 94 | + |
| 95 | + onComplete?.Invoke(response); |
| 96 | + }), true, LootLockerCallerRole.User); |
| 97 | + } |
| 98 | + } |
| 99 | +} |
0 commit comments