From ae5822b4c6723a6edbd780da056060a030ee6315 Mon Sep 17 00:00:00 2001 From: EliphasNUIT Date: Sat, 29 Jul 2023 21:15:29 +0200 Subject: [PATCH] renaming --- GW2EIDPSReport/DPSReportController.cs | 18 +++++++++--------- ...GetUploadsObject.cs => GetUploadsObject.cs} | 4 ++-- ...PSReportReportObject.cs => ReportObject.cs} | 2 +- ...unterObject.cs => UploadEncounterObject.cs} | 2 +- ...UploadEvtcObject.cs => UploadEvtcObject.cs} | 2 +- ...PSReportUploadObject.cs => UploadObject.cs} | 10 +++++----- ...adPlayerObject.cs => UploadPlayerObject.cs} | 2 +- GW2EIDPSReport/GW2EIDPSReport.csproj | 2 +- GW2EIParser/ProgramHelper.cs | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) rename GW2EIDPSReport/DPSReportJsons/{DPSReportGetUploadsObject.cs => GetUploadsObject.cs} (81%) rename GW2EIDPSReport/DPSReportJsons/{DPSReportReportObject.cs => ReportObject.cs} (87%) rename GW2EIDPSReport/DPSReportJsons/{DPSReportUploadEncounterObject.cs => UploadEncounterObject.cs} (95%) rename GW2EIDPSReport/DPSReportJsons/{DPSReportUploadEvtcObject.cs => UploadEvtcObject.cs} (87%) rename GW2EIDPSReport/DPSReportJsons/{DPSReportUploadObject.cs => UploadObject.cs} (77%) rename GW2EIDPSReport/DPSReportJsons/{DPSReportUploadPlayerObject.cs => UploadPlayerObject.cs} (91%) diff --git a/GW2EIDPSReport/DPSReportController.cs b/GW2EIDPSReport/DPSReportController.cs index db3db583f3..2a36875dbc 100644 --- a/GW2EIDPSReport/DPSReportController.cs +++ b/GW2EIDPSReport/DPSReportController.cs @@ -91,14 +91,14 @@ private static string GetGetUploadsURL(GetUploadsParameters parameters, string u return GetURL(url, userToken); } ///////////////// APIs - public static DPSReportUploadObject UploadUsingEI(FileInfo fi, List traces, string userToken, bool anonymous = false, bool detailedWvW = false) + public static UploadObject UploadUsingEI(FileInfo fi, List traces, string userToken, bool anonymous = false, bool detailedWvW = false) { return UploadToDPSR(fi, GetUploadContentURL(BaseUploadContentURL, userToken, anonymous, detailedWvW) + "&generator=ei", traces); } - public static DPSReportGetUploadsObject GetUploads(List traces, string userToken, GetUploadsParameters parameters) + public static GetUploadsObject GetUploads(List traces, string userToken, GetUploadsParameters parameters) { - return GetDPSReportResponse("GetUploads", GetGetUploadsURL(parameters, userToken), traces); + return GetDPSReportResponse("GetUploads", GetGetUploadsURL(parameters, userToken), traces); } public static string GenerateUserToken(List traces) { @@ -109,21 +109,21 @@ public static string GenerateUserToken(List traces) } return ""; } - public static DPSReportUploadObject GetUploadMetaDataWithID(string id, List traces) + public static UploadObject GetUploadMetaDataWithID(string id, List traces) { if (id == null || id.Length == 0) { throw new InvalidDataException("Missing ID for GetUploadMetaData end point"); } - return GetDPSReportResponse("GetUploadMetaDataWithID", BaseGetUploadMetadataURL + "id=" + id, traces); + return GetDPSReportResponse("GetUploadMetaDataWithID", BaseGetUploadMetadataURL + "id=" + id, traces); } - public static DPSReportUploadObject GetUploadMetaDataWithPermalink(string permalink, List traces) + public static UploadObject GetUploadMetaDataWithPermalink(string permalink, List traces) { if (permalink == null || permalink.Length == 0) { throw new InvalidDataException("Missing Permalink for GetUploadMetaData end point"); } - return GetDPSReportResponse("GetUploadMetaDataWithPermalink", BaseGetUploadMetadataURL + "permalink=" + permalink, traces); + return GetDPSReportResponse("GetUploadMetaDataWithPermalink", BaseGetUploadMetadataURL + "permalink=" + permalink, traces); } public static T GetJsonWithID(string id, List traces) @@ -192,7 +192,7 @@ private static T GetDPSReportResponse(string requestName, string URI, List traces) + private static UploadObject UploadToDPSR(FileInfo fi, string URI, List traces) { string fileName = fi.Name; byte[] fileContents = File.ReadAllBytes(fi.FullName); @@ -228,7 +228,7 @@ private static DPSReportUploadObject UploadToDPSR(FileInfo fi, string URI, List< { Task stringContentsTask = responseContent.ReadAsStringAsync(); string stringContents = stringContentsTask.Result; - DPSReportUploadObject item = JsonConvert.DeserializeObject(stringContents, new JsonSerializerSettings + UploadObject item = JsonConvert.DeserializeObject(stringContents, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, ContractResolver = DefaultJsonContractResolver, diff --git a/GW2EIDPSReport/DPSReportJsons/DPSReportGetUploadsObject.cs b/GW2EIDPSReport/DPSReportJsons/GetUploadsObject.cs similarity index 81% rename from GW2EIDPSReport/DPSReportJsons/DPSReportGetUploadsObject.cs rename to GW2EIDPSReport/DPSReportJsons/GetUploadsObject.cs index b9e99f4390..f9be5f5007 100644 --- a/GW2EIDPSReport/DPSReportJsons/DPSReportGetUploadsObject.cs +++ b/GW2EIDPSReport/DPSReportJsons/GetUploadsObject.cs @@ -2,7 +2,7 @@ namespace GW2EIDPSReport.DPSReportJsons { - public class DPSReportGetUploadsObject + public class GetUploadsObject { [JsonProperty] public int Pages { get; internal set; } @@ -15,6 +15,6 @@ public class DPSReportGetUploadsObject [JsonProperty] public string UserToken { get; internal set; } [JsonProperty] - public DPSReportUploadObject[] Uploads { get; internal set; } + public UploadObject[] Uploads { get; internal set; } } } diff --git a/GW2EIDPSReport/DPSReportJsons/DPSReportReportObject.cs b/GW2EIDPSReport/DPSReportJsons/ReportObject.cs similarity index 87% rename from GW2EIDPSReport/DPSReportJsons/DPSReportReportObject.cs rename to GW2EIDPSReport/DPSReportJsons/ReportObject.cs index 3ccf7d4c74..7f62974499 100644 --- a/GW2EIDPSReport/DPSReportJsons/DPSReportReportObject.cs +++ b/GW2EIDPSReport/DPSReportJsons/ReportObject.cs @@ -3,7 +3,7 @@ namespace GW2EIDPSReport.DPSReportJsons { - public class DPSReportReportObject + public class ReportObject { [JsonProperty] public bool Anonymous { get; internal set; } diff --git a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadEncounterObject.cs b/GW2EIDPSReport/DPSReportJsons/UploadEncounterObject.cs similarity index 95% rename from GW2EIDPSReport/DPSReportJsons/DPSReportUploadEncounterObject.cs rename to GW2EIDPSReport/DPSReportJsons/UploadEncounterObject.cs index 8c917717ce..24cd4d04ef 100644 --- a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadEncounterObject.cs +++ b/GW2EIDPSReport/DPSReportJsons/UploadEncounterObject.cs @@ -2,7 +2,7 @@ namespace GW2EIDPSReport.DPSReportJsons { - public class DPSReportUploadEncounterObject + public class UploadEncounterObject { [JsonProperty] public string UniqueId { get; internal set; } diff --git a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadEvtcObject.cs b/GW2EIDPSReport/DPSReportJsons/UploadEvtcObject.cs similarity index 87% rename from GW2EIDPSReport/DPSReportJsons/DPSReportUploadEvtcObject.cs rename to GW2EIDPSReport/DPSReportJsons/UploadEvtcObject.cs index e412178a88..20ac49824a 100644 --- a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadEvtcObject.cs +++ b/GW2EIDPSReport/DPSReportJsons/UploadEvtcObject.cs @@ -2,7 +2,7 @@ namespace GW2EIDPSReport.DPSReportJsons { - public class DPSReportUploadEvtcObject + public class UploadEvtcObject { [JsonProperty] public string Type { get; internal set; } diff --git a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadObject.cs b/GW2EIDPSReport/DPSReportJsons/UploadObject.cs similarity index 77% rename from GW2EIDPSReport/DPSReportJsons/DPSReportUploadObject.cs rename to GW2EIDPSReport/DPSReportJsons/UploadObject.cs index e4d6436485..4091cc15ea 100644 --- a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadObject.cs +++ b/GW2EIDPSReport/DPSReportJsons/UploadObject.cs @@ -3,7 +3,7 @@ namespace GW2EIDPSReport.DPSReportJsons { - public class DPSReportUploadObject + public class UploadObject { [JsonProperty] public string Id { get; internal set; } @@ -30,13 +30,13 @@ public class DPSReportUploadObject [JsonProperty] public string Error { get; internal set; } [JsonProperty] - public DPSReportUploadEncounterObject Encounter { get; internal set; } + public UploadEncounterObject Encounter { get; internal set; } [JsonProperty] - public DPSReportUploadEvtcObject Evtc { get; internal set; } + public UploadEvtcObject Evtc { get; internal set; } [JsonProperty] - public Dictionary Players { get; internal set; } + public Dictionary Players { get; internal set; } [JsonProperty] - public DPSReportReportObject Report { get; internal set; } + public ReportObject Report { get; internal set; } [JsonProperty] public string TempApiId { get; internal set; } } diff --git a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadPlayerObject.cs b/GW2EIDPSReport/DPSReportJsons/UploadPlayerObject.cs similarity index 91% rename from GW2EIDPSReport/DPSReportJsons/DPSReportUploadPlayerObject.cs rename to GW2EIDPSReport/DPSReportJsons/UploadPlayerObject.cs index c4e1e2a8f2..fd20814f81 100644 --- a/GW2EIDPSReport/DPSReportJsons/DPSReportUploadPlayerObject.cs +++ b/GW2EIDPSReport/DPSReportJsons/UploadPlayerObject.cs @@ -2,7 +2,7 @@ namespace GW2EIDPSReport.DPSReportJsons { - public class DPSReportUploadPlayerObject + public class UploadPlayerObject { [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; internal set; } diff --git a/GW2EIDPSReport/GW2EIDPSReport.csproj b/GW2EIDPSReport/GW2EIDPSReport.csproj index 8966d17332..ba66ec267d 100644 --- a/GW2EIDPSReport/GW2EIDPSReport.csproj +++ b/GW2EIDPSReport/GW2EIDPSReport.csproj @@ -15,7 +15,7 @@ AllEnabledByDefault - 4.0.0 + 5.0.0 EliphasNUIT GW2 Elite Insights GW2 Elite Insights diff --git a/GW2EIParser/ProgramHelper.cs b/GW2EIParser/ProgramHelper.cs index 1ade637a71..9beb254f31 100644 --- a/GW2EIParser/ProgramHelper.cs +++ b/GW2EIParser/ProgramHelper.cs @@ -117,7 +117,7 @@ private static string[] UploadOperation(List traces, FileInfo fInfo) if (Properties.Settings.Default.UploadToDPSReports) { traces.Add("Uploading to DPSReports using EI"); - DPSReportUploadObject response = DPSReportController.UploadUsingEI(fInfo, traces, Properties.Settings.Default.DPSReportUserToken, + UploadObject response = DPSReportController.UploadUsingEI(fInfo, traces, Properties.Settings.Default.DPSReportUserToken, Properties.Settings.Default.Anonymous, Properties.Settings.Default.DetailledWvW); uploadresult[0] = response != null ? response.Permalink : "Upload process failed";