From 1c6e8403e3d6f5cfeb1c71202a6d0a9506c8b3ce Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 28 Aug 2024 21:50:58 +0200 Subject: [PATCH 1/4] Added support for eTag and CancellationToken for each method. Added fallback logic for eTag to keep old compatibility. Updated nugets and added support for .net8 Marked `SetIfNoneMatchHeader` as Obsolete --- ESI.NET/ESI.NET.csproj | 20 +- ESI.NET/EsiClient.cs | 1 + ESI.NET/EsiRequest.cs | 29 +- ESI.NET/Logic/AllianceLogic.cs | 37 ++- ESI.NET/Logic/AssetsLogic.cs | 44 ++- ESI.NET/Logic/BookmarksLogic.cs | 37 ++- ESI.NET/Logic/CalendarLogic.cs | 32 +- ESI.NET/Logic/CharacterLogic.cs | 101 +++++-- ESI.NET/Logic/ClonesLogic.cs | 17 +- ESI.NET/Logic/ContactsLogic.cs | 64 ++-- ESI.NET/Logic/ContractsLogic.cs | 75 +++-- ESI.NET/Logic/CorporationLogic.cs | 177 ++++++++--- ESI.NET/Logic/DogmaLogic.cs | 48 ++- ESI.NET/Logic/FactionWarfareLogic.cs | 63 +++- ESI.NET/Logic/FittingsLogic.cs | 21 +- ESI.NET/Logic/FleetsLogic.cs | 119 +++++--- ESI.NET/Logic/IncursionsLogic.cs | 14 +- ESI.NET/Logic/IndustryLogic.cs | 67 ++++- ESI.NET/Logic/InsuranceLogic.cs | 15 +- ESI.NET/Logic/KillmailsLogic.cs | 26 +- ESI.NET/Logic/LocationLogic.cs | 22 +- ESI.NET/Logic/LoyaltyLogic.cs | 17 +- ESI.NET/Logic/MailLogic.cs | 68 +++-- ESI.NET/Logic/MarketLogic.cs | 96 ++++-- ESI.NET/Logic/OpportunitiesLogic.cs | 40 ++- ESI.NET/Logic/PlanetaryInteractionLogic.cs | 32 +- ESI.NET/Logic/RoutesLogic.cs | 24 +- ESI.NET/Logic/SearchLogic.cs | 26 +- ESI.NET/Logic/SkillsLogic.cs | 25 +- ESI.NET/Logic/SovereigntyLogic.cs | 31 +- ESI.NET/Logic/StatusLogic.cs | 14 +- ESI.NET/Logic/UniverseLogic.cs | 322 ++++++++++++++------- ESI.NET/Logic/UserInterfaceLogic.cs | 33 ++- ESI.NET/Logic/WalletLogic.cs | 57 +++- ESI.NET/Logic/WarsLogic.cs | 27 +- ESI.NET/Logic/_SSOLogic.cs | 50 ++-- 36 files changed, 1366 insertions(+), 525 deletions(-) diff --git a/ESI.NET/ESI.NET.csproj b/ESI.NET/ESI.NET.csproj index cb1585f..42392cf 100644 --- a/ESI.NET/ESI.NET.csproj +++ b/ESI.NET/ESI.NET.csproj @@ -8,7 +8,7 @@ - netcoreapp3.1;netstandard2.0;net462;net47;net471;net472;net48;net6.0;net7.0 + net6.0;net7.0;netcoreapp3.1;netstandard2.0;net8.0 true 2023.12.12 Psianna Archeia @@ -21,15 +21,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/ESI.NET/EsiClient.cs b/ESI.NET/EsiClient.cs index 5b00fe4..b84e5e1 100644 --- a/ESI.NET/EsiClient.cs +++ b/ESI.NET/EsiClient.cs @@ -141,6 +141,7 @@ public void SetCharacterData(AuthorizedCharacterData data) Universe = new UniverseLogic(client, config, data); } + [Obsolete] public void SetIfNoneMatchHeader(string eTag) => EsiRequest.ETag = eTag; } diff --git a/ESI.NET/EsiRequest.cs b/ESI.NET/EsiRequest.cs index 73b7606..ea78ca3 100644 --- a/ESI.NET/EsiRequest.cs +++ b/ESI.NET/EsiRequest.cs @@ -4,6 +4,7 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace ESI.NET @@ -12,7 +13,18 @@ internal static class EsiRequest { internal static string ETag; - public static async Task> Execute(HttpClient client, EsiConfig config, RequestSecurity security, HttpMethod httpMethod, string endpoint, Dictionary replacements = null, string[] parameters = null, object body = null, string token = null) + public static async Task> Execute( + HttpClient client, + EsiConfig config, + RequestSecurity security, + HttpMethod httpMethod, + string endpoint, + string eTag = null, + CancellationToken cancellationToken = default, + Dictionary replacements = null, + string[] parameters = null, + object body = null, + string token = null) { var path = $"{httpMethod}|{endpoint}"; @@ -32,22 +44,23 @@ public static async Task> Execute(HttpClient client, EsiConfig if (security == RequestSecurity.Authenticated) { if (token == null) - throw new ArgumentException("The request endpoint requires SSO authentication and a Token has not been provided."); + throw new ArgumentException( + "The request endpoint requires SSO authentication and a Token has not been provided."); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); } - if (ETag != null) + if (eTag != null || ETag != null) { - request.Headers.Add("If-None-Match", $"\"{ETag}\""); - ETag = null; + request.Headers.Add("If-None-Match", $"\"{eTag ?? ETag}\""); } //Serialize post body data if (body != null) - request.Content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"); + request.Content = + new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"); //Output final object - return new EsiResponse(await client.SendAsync(request).ConfigureAwait(false), path); + return new EsiResponse(await client.SendAsync(request, cancellationToken).ConfigureAwait(false), path); } public enum RequestSecurity @@ -56,4 +69,4 @@ public enum RequestSecurity Authenticated } } -} +} \ No newline at end of file diff --git a/ESI.NET/Logic/AllianceLogic.cs b/ESI.NET/Logic/AllianceLogic.cs index 2433f17..b2e1467 100644 --- a/ESI.NET/Logic/AllianceLogic.cs +++ b/ESI.NET/Logic/AllianceLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.Alliance; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -12,22 +13,32 @@ public class AllianceLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public AllianceLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public AllianceLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /alliances/ /// /// - public async Task> All() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/alliances/"); + public async Task> All(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/alliances/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /alliances/{alliance_id}/ /// /// /// - public async Task> Information(int alliance_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/alliances/{alliance_id}/", + public async Task> Information(int alliance_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/alliances/{alliance_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "alliance_id", alliance_id.ToString() } @@ -38,8 +49,12 @@ public async Task> Information(int alliance_id) /// /// /// - public async Task> Corporations(int alliance_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/alliances/{alliance_id}/corporations/", + public async Task> Corporations(int alliance_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/alliances/{alliance_id}/corporations/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "alliance_id", alliance_id.ToString() } @@ -50,8 +65,12 @@ public async Task> Corporations(int alliance_id) /// /// /// - public async Task> Icons(int alliance_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/alliances/{alliance_id}/icons/", + public async Task> Icons(int alliance_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/alliances/{alliance_id}/icons/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "alliance_id", alliance_id.ToString() } diff --git a/ESI.NET/Logic/AssetsLogic.cs b/ESI.NET/Logic/AssetsLogic.cs index 7a3d86d..0bedda8 100644 --- a/ESI.NET/Logic/AssetsLogic.cs +++ b/ESI.NET/Logic/AssetsLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -32,8 +33,12 @@ public AssetsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /// /// - public async Task>> ForCharacter(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/assets/", + public async Task>> ForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/assets/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -49,8 +54,11 @@ public async Task>> ForCharacter(int page = 1) /// /// /// - public async Task>> LocationsForCharacter(List item_ids) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/assets/locations/", + public async Task>> LocationsForCharacter(List item_ids, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/assets/locations/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -63,8 +71,11 @@ public async Task>> LocationsForCharacter(List /// /// - public async Task>> NamesForCharacter(List item_ids) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/assets/names/", + public async Task>> NamesForCharacter(List item_ids, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/assets/names/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -78,8 +89,12 @@ public async Task>> NamesForCharacter(List item /// /// /// - public async Task>> ForCorporation(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/assets/", + public async Task>> ForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/assets/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -95,8 +110,11 @@ public async Task>> ForCorporation(int page = 1) /// /// /// - public async Task>> LocationsForCorporation(List item_ids) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/corporations/{corporation_id}/assets/locations/", + public async Task>> LocationsForCorporation(List item_ids, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/corporations/{corporation_id}/assets/locations/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -109,8 +127,10 @@ public async Task>> LocationsForCorporation(List< /// /// /// - public async Task>> NamesForCorporation(List item_ids) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/corporations/{corporation_id}/assets/names/", + public async Task>> NamesForCorporation(List item_ids, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/corporations/{corporation_id}/assets/names/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } diff --git a/ESI.NET/Logic/BookmarksLogic.cs b/ESI.NET/Logic/BookmarksLogic.cs index 3c5089a..42c95af 100644 --- a/ESI.NET/Logic/BookmarksLogic.cs +++ b/ESI.NET/Logic/BookmarksLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -14,7 +15,9 @@ public class BookmarksLogic private readonly AuthorizedCharacterData _data; private readonly int character_id, corporation_id; - public BookmarksLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData data = null) + public BookmarksLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData data = null, + string eTag = null, + CancellationToken cancellationToken = default) { _client = client; _config = config; @@ -31,8 +34,12 @@ public BookmarksLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDa /// /characters/{character_id}/bookmarks/ /// /// - public async Task>> ForCharacter(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/bookmarks/", + public async Task>> ForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/bookmarks/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -47,8 +54,12 @@ public async Task>> ForCharacter(int page = 1) /// /characters/{character_id}/bookmarks/folders/ /// /// - public async Task>> FoldersForCharacter(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/bookmarks/folders/", + public async Task>> FoldersForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/bookmarks/folders/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -63,8 +74,12 @@ public async Task>> FoldersForCharacter(int page = 1) /// /corporations/{corporation_id}/bookmarks/ /// /// - public async Task>> ForCorporation(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/bookmarks/", + public async Task>> ForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/bookmarks/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -79,8 +94,12 @@ public async Task>> ForCorporation(int page = 1) /// /corporations/{corporation_id}/bookmarks/folders/ /// /// - public async Task>> FoldersForCorporation(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/bookmarks/folders/", + public async Task>> FoldersForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/bookmarks/folders/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } diff --git a/ESI.NET/Logic/CalendarLogic.cs b/ESI.NET/Logic/CalendarLogic.cs index 18da2b6..83db6a7 100644 --- a/ESI.NET/Logic/CalendarLogic.cs +++ b/ESI.NET/Logic/CalendarLogic.cs @@ -3,6 +3,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -29,8 +30,12 @@ public CalendarLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /characters/{character_id}/calendar/ /// /// - public async Task>> Events() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/calendar/", + public async Task>> Events(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/calendar/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -42,8 +47,12 @@ public async Task>> Events() /// /// /// - public async Task> Event(int event_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/calendar/{event_id}/", + public async Task> Event(int event_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/calendar/{event_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -57,8 +66,11 @@ public async Task> Event(int event_id) /// /// /// - public async Task> Respond(int event_id, EventResponse eventResponse) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/characters/{character_id}/calendar/{event_id}/", + public async Task> Respond(int event_id, EventResponse eventResponse, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/characters/{character_id}/calendar/{event_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -75,8 +87,12 @@ public async Task> Respond(int event_id, EventResponse eventR /// /// /// - public async Task>> Responses(int event_id) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/calendar/{event_id}/attendees/", + public async Task>> Responses(int event_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/calendar/{event_id}/attendees/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, diff --git a/ESI.NET/Logic/CharacterLogic.cs b/ESI.NET/Logic/CharacterLogic.cs index 965ae03..eeb017a 100644 --- a/ESI.NET/Logic/CharacterLogic.cs +++ b/ESI.NET/Logic/CharacterLogic.cs @@ -3,6 +3,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -30,8 +31,11 @@ public CharacterLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDa /// /// dynamic = long /// - public async Task>> Affiliation(int[] character_ids) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Post, "/characters/affiliation/", + public async Task>> Affiliation(int[] character_ids, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Post, + "/characters/affiliation/", + cancellationToken: cancellationToken, body: character_ids); /// @@ -39,8 +43,12 @@ public async Task>> Affiliation(int[] character_id /// /// /// - public async Task>> Names(int[] character_ids) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/characters/names/", + public async Task>> Names(int[] character_ids, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/characters/names/", + eTag: eTag, + cancellationToken: cancellationToken, parameters: new string[] { $"character_ids={string.Join(",", character_ids)}" @@ -51,8 +59,12 @@ public async Task>> Names(int[] character_ids) /// /// /// - public async Task> Information(int character_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/characters/{character_id}/", + public async Task> Information(int character_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/characters/{character_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -62,8 +74,12 @@ public async Task> Information(int character_id) /// /characters/{character_id}/agents_research/ /// /// - public async Task>> AgentsResearch() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/agents_research/", + public async Task>> AgentsResearch(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/agents_research/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -75,8 +91,12 @@ public async Task>> AgentsResearch() /// /// Which page of results to return /// - public async Task>> Blueprints(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/blueprints/", + public async Task>> Blueprints(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/blueprints/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -91,8 +111,12 @@ public async Task>> Blueprints(int page = 1) /// /characters/{character_id}/chat_channels/ /// /// - public async Task>> ChatChannels() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/chat_channels/", + public async Task>> ChatChannels(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/chat_channels/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -104,8 +128,12 @@ public async Task>> ChatChannels() /// /// /// - public async Task>> CorporationHistory(int character_id) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/characters/{character_id}/corporationhistory/", + public async Task>> CorporationHistory(int character_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/characters/{character_id}/corporationhistory/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -116,8 +144,10 @@ public async Task>> CorporationHistory(int /// /// The target characters to calculate the charge for /// - public async Task> CSPA(object character_ids) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/cspa/", + public async Task> CSPA(object character_ids, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/cspa/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -129,8 +159,12 @@ public async Task> CSPA(object character_ids) /// /characters/{character_id}/fatigue/ /// /// - public async Task> Fatigue() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/fatigue/", + public async Task> Fatigue(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/fatigue/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -141,8 +175,12 @@ public async Task> Fatigue() /// /characters/{character_id}/medals/ /// /// - public async Task>> Medals() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/medals/", + public async Task>> Medals(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/medals/", + eTag: eTag, + cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -153,8 +191,12 @@ public async Task>> Medals() /// /characters/{character_id}/notifications/ /// /// - public async Task>> Notifications() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/notifications/", + public async Task>> Notifications(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/notifications/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -166,7 +208,8 @@ public async Task>> Notifications() /// /// public async Task>> ContactNotifications() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/notifications/contacts/", + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/notifications/contacts/", replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -179,7 +222,8 @@ public async Task>> ContactNotifications() /// /// public async Task> Portrait(int character_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/characters/{character_id}/portrait/", + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/characters/{character_id}/portrait/", replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -190,7 +234,8 @@ public async Task> Portrait(int character_id) /// /// public async Task> Roles() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/roles/", + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/roles/", replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -202,7 +247,8 @@ public async Task> Roles() /// /// public async Task>> Standings() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/standings/", + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/standings/", replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -214,7 +260,8 @@ public async Task>> Standings() /// /// public async Task>> Titles() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/titles/", + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/titles/", replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/ClonesLogic.cs b/ESI.NET/Logic/ClonesLogic.cs index a03e7c4..e453cc4 100644 --- a/ESI.NET/Logic/ClonesLogic.cs +++ b/ESI.NET/Logic/ClonesLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -28,8 +29,12 @@ public ClonesLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /characters/{character_id}/clones/ /// /// - public async Task> List() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/clones/", + public async Task> List(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/clones/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -40,8 +45,12 @@ public async Task> List() /// /characters/{character_id}/implants/ /// /// - public async Task> Implants() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/implants/", + public async Task> Implants(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/implants/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/ContactsLogic.cs b/ESI.NET/Logic/ContactsLogic.cs index 55a25a7..52d3757 100644 --- a/ESI.NET/Logic/ContactsLogic.cs +++ b/ESI.NET/Logic/ContactsLogic.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -35,8 +36,12 @@ public ContactsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /// /// - public async Task>> ListForCharacter(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/contacts/", + public async Task>> ListForCharacter(int page = 1, + string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/contacts/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -52,8 +57,12 @@ public async Task>> ListForCharacter(int page = 1) /// /// /// - public async Task>> ListForCorporation(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/contacts/", + public async Task>> ListForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/contacts/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -69,8 +78,12 @@ public async Task>> ListForCorporation(int page = 1) /// /// /// - public async Task>> ListForAlliance(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/alliances/{alliance_id}/contacts/", + public async Task>> ListForAlliance(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/alliances/{alliance_id}/contacts/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "alliance_id", alliance_id.ToString() } @@ -89,7 +102,8 @@ public async Task>> ListForAlliance(int page = 1) /// /// /// - public async Task> Add(int[] contact_ids, decimal standing, int[] label_ids = null, bool? watched = null) + public async Task> Add(int[] contact_ids, decimal standing, int[] label_ids = null, + bool? watched = null,CancellationToken cancellationToken = default) { var body = contact_ids; @@ -101,7 +115,9 @@ public async Task> Add(int[] contact_ids, decimal standing, i if (watched != null) parameters.Add($"watched={watched}"); - return await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/contacts/", + return await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/contacts/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -119,7 +135,8 @@ public async Task> Add(int[] contact_ids, decimal standing, i /// /// /// - public async Task> Update(int[] contact_ids, decimal standing, int[] label_ids = null, bool? watched = null) + public async Task> Update(int[] contact_ids, decimal standing, int[] label_ids = null, + bool? watched = null, CancellationToken cancellationToken = default) { var body = contact_ids; @@ -131,7 +148,9 @@ public async Task> Update(int[] contact_ids, decimal standin if (watched != null) parameters.Add($"watched={watched}"); - return await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/characters/{character_id}/contacts/", + return await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/characters/{character_id}/contacts/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -146,8 +165,10 @@ public async Task> Update(int[] contact_ids, decimal standin /// /// /// - public async Task> Delete(int[] contact_ids) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/characters/{character_id}/contacts/", + public async Task> Delete(int[] contact_ids, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/characters/{character_id}/contacts/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -162,8 +183,12 @@ public async Task> Delete(int[] contact_ids) /// /characters/{character_id}/contacts/labels/ /// /// - public async Task>> LabelsForCharacter() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/contacts/labels/", + public async Task>> LabelsForCharacter(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/contacts/labels/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -174,8 +199,12 @@ public async Task>> LabelsForCharacter() /// /corporations/{corporation_id}/contacts/labels/ /// /// - public async Task>> LabelsForCorporation() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/contacts/labels/", + public async Task>> LabelsForCorporation(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/contacts/labels/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -187,7 +216,8 @@ public async Task>> LabelsForCorporation() /// /// public async Task>> LabelsForAlliance() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/alliances/{alliance_id}/contacts/labels/", + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/alliances/{alliance_id}/contacts/labels/", replacements: new Dictionary() { { "alliance_id", alliance_id.ToString() } diff --git a/ESI.NET/Logic/ContractsLogic.cs b/ESI.NET/Logic/ContractsLogic.cs index a83c643..3db04d7 100644 --- a/ESI.NET/Logic/ContractsLogic.cs +++ b/ESI.NET/Logic/ContractsLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -32,8 +33,12 @@ public ContractsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDa /// /// /// - public async Task>> Contracts(int region_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/contracts/public/{region_id}/", + public async Task>> Contracts(int region_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/contracts/public/{region_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "region_id", region_id.ToString() } @@ -48,8 +53,13 @@ public async Task>> Contracts(int region_id, int page /// /// /// - public async Task>> ContractItems(int contract_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/contracts/public/items/{contract_id}/", + public async Task>> ContractItems(int contract_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/contracts/public/items/{contract_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "contract_id", contract_id.ToString() } @@ -64,8 +74,12 @@ public async Task>> ContractItems(int contract_id /// /// /// - public async Task>> ContractBids(int contract_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/contracts/public/bids/{contract_id}/", + public async Task>> ContractBids(int contract_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/contracts/public/bids/{contract_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "contract_id", contract_id.ToString() } @@ -79,8 +93,12 @@ public async Task>> ContractBids(int contract_id, int page /// /characters/{character_id}/contracts/ /// /// - public async Task>> CharacterContracts(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/contracts/", + public async Task>> CharacterContracts(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/contracts/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -96,8 +114,12 @@ public async Task>> CharacterContracts(int page = 1) /// /// /// - public async Task>> CharacterContractItems(int contract_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/contracts/{contract_id}/items/", + public async Task>> CharacterContractItems(int contract_id, int page = 1, + string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/contracts/{contract_id}/items/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -114,8 +136,12 @@ public async Task>> CharacterContractItems(int co /// /// /// - public async Task>> CharacterContractBids(int contract_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/contracts/{contract_id}/bids/", + public async Task>> CharacterContractBids(int contract_id, int page = 1, + string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/contracts/{contract_id}/bids/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -131,8 +157,12 @@ public async Task>> CharacterContractBids(int contract_id, /// /corporations/{corporation_id}/contracts/ /// /// - public async Task>> CorporationContracts(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/contracts/", + public async Task>> CorporationContracts(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/contracts/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -148,8 +178,13 @@ public async Task>> CorporationContracts(int page = 1 /// /// /// - public async Task>> CorporationContractItems(int contract_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/contracts/{contract_id}/items/", + public async Task>> CorporationContractItems(int contract_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/contracts/{contract_id}/items/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() }, @@ -166,8 +201,12 @@ public async Task>> CorporationContractItems(int /// /// /// - public async Task>> CorporationContractBids(int contract_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/contracts/{contract_id}/bids/", + public async Task>> CorporationContractBids(int contract_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/contracts/{contract_id}/bids/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() }, diff --git a/ESI.NET/Logic/CorporationLogic.cs b/ESI.NET/Logic/CorporationLogic.cs index ec08b91..514362a 100644 --- a/ESI.NET/Logic/CorporationLogic.cs +++ b/ESI.NET/Logic/CorporationLogic.cs @@ -3,6 +3,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -29,16 +30,24 @@ public CorporationLogic(HttpClient client, EsiConfig config, AuthorizedCharacter /// /corporations/npccorps/ /// /// - public async Task> NpcCorps() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/corporations/npccorps/"); + public async Task> NpcCorps(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/corporations/npccorps/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /corporations/{corporation_id}/ /// /// /// - public async Task> Information(int corporation_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/corporations/{corporation_id}/", + public async Task> Information(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/corporations/{corporation_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -49,8 +58,12 @@ public async Task> Information(int corporation_id) /// /// /// - public async Task>> AllianceHistory(int corporation_id) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/corporations/{corporation_id}/alliancehistory/", + public async Task>> AllianceHistory(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/corporations/{corporation_id}/alliancehistory/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -61,8 +74,12 @@ public async Task>> AllianceHistory(int corpor /// /// /// - public async Task>> Blueprints(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/blueprints/", + public async Task>> Blueprints(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/blueprints/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -78,8 +95,12 @@ public async Task>> Blueprints(int page = 1) /// /// /// - public async Task>> ContainerLogs(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/containers/logs/", + public async Task>> ContainerLogs(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/containers/logs/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -94,8 +115,12 @@ public async Task>> ContainerLogs(int page = 1) /// /corporations/{corporation_id}/divisions/ /// /// - public async Task> Divisions() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/divisions/", + public async Task> Divisions(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/divisions/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -106,8 +131,12 @@ public async Task> Divisions() /// /corporations/{corporation_id}/facilities/ /// /// - public async Task>> Facilities() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/facilities/", + public async Task>> Facilities(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/facilities/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -119,8 +148,12 @@ public async Task>> Facilities() /// /// /// - public async Task> Icons(int corporation_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/corporations/{corporation_id}/icons/", + public async Task> Icons(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/corporations/{corporation_id}/icons/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -131,8 +164,12 @@ public async Task> Icons(int corporation_id) /// /// /// - public async Task>> Medals(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/medals/", + public async Task>> Medals(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/medals/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -147,8 +184,12 @@ public async Task>> Medals(int page = 1) /// /// /// - public async Task>> MedalsIssued(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/medals/issued/", + public async Task>> MedalsIssued(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/medals/issued/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -163,8 +204,12 @@ public async Task>> MedalsIssued(int page = 1) /// /corporations/{corporation_id}/members/ /// /// - public async Task> Members() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/members/", + public async Task> Members(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/members/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -175,8 +220,12 @@ public async Task> Members() /// /corporations/{corporation_id}/members/limit/ /// /// - public async Task> MemberLimit() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/members/limit/", + public async Task> MemberLimit(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/members/limit/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -187,8 +236,12 @@ public async Task> MemberLimit() /// /corporations/{corporation_id}/members/titles/ /// /// - public async Task>> MemberTitles() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/members/titles/", + public async Task>> MemberTitles(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/members/titles/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -199,8 +252,12 @@ public async Task>> MemberTitles() /// /corporations/{corporation_id}/membertracking/ /// /// - public async Task>> MemberTracking() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/membertracking/", + public async Task>> MemberTracking(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/membertracking/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -211,8 +268,12 @@ public async Task>> MemberTracking() /// /corporations/{corporation_id}/roles/ /// /// - public async Task>> Roles() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/roles/", + public async Task>> Roles(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/roles/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -223,8 +284,12 @@ public async Task>> Roles() /// /corporations/{corporation_id}/roles/history/ /// /// - public async Task>> RolesHistory() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/roles/history/", + public async Task>> RolesHistory(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, + HttpMethod.Get, "/corporations/{corporation_id}/roles/history/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -236,8 +301,12 @@ public async Task>> RolesHistory() /// /// /// - public async Task>> Shareholders(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/shareholders/", + public async Task>> Shareholders(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/shareholders/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -252,8 +321,12 @@ public async Task>> Shareholders(int page = 1) /// /// /// - public async Task> Standings(int page = 1) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/standings/", + public async Task> Standings(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/standings/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -269,8 +342,12 @@ public async Task> Standings(int page = 1) /// /// /// - public async Task>> Starbases(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/starbases/", + public async Task>> Starbases(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/starbases/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -287,8 +364,12 @@ public async Task>> Starbases(int page = 1) /// /// /// - public async Task> Starbase(long starbase_id, int system_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/starbases/{starbase_id}/", + public async Task> Starbase(long starbase_id, int system_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/starbases/{starbase_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() }, @@ -304,8 +385,12 @@ public async Task> Starbase(long starbase_id, int syst /// /corporations/{corporation_id}/structures/ /// /// - public async Task>> Structures(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/structures/", + public async Task>> Structures(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/structures/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -320,8 +405,12 @@ public async Task>> Structures(int page = 1) /// /corporations/{corporation_id}/titles/ /// /// - public async Task>> Titles() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/titles/", + public async Task>> Titles(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/titles/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } diff --git a/ESI.NET/Logic/DogmaLogic.cs b/ESI.NET/Logic/DogmaLogic.cs index 71f7869..27c8c66 100644 --- a/ESI.NET/Logic/DogmaLogic.cs +++ b/ESI.NET/Logic/DogmaLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Models.Dogma; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -11,41 +12,60 @@ public class DogmaLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public DogmaLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public DogmaLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /dogma/attributes/ /// /// - public async Task> Attributes() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/attributes/"); + public async Task> Attributes(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/attributes/", + eTag: eTag, cancellationToken: cancellationToken); /// /// /dogma/attributes/{attribute_id}/ /// /// /// - public async Task> Attribute(int attribute_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/attributes/{attribute_id}/", + public async Task> Attribute(int attribute_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/dogma/attributes/{attribute_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { - { "attribute_id", attribute_id.ToString() } + { + "attribute_id", attribute_id.ToString() + } }); /// /// /dogma/effects/ /// /// - public async Task> Effects() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/effects/"); + public async Task> Effects(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/effects/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /dogma/effects/{effect_id}/ /// /// /// - public async Task> Effect(int effect_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/effects/{effect_id}/", + public async Task> Effect(int effect_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/dogma/effects/{effect_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "effect_id", effect_id.ToString() } @@ -57,8 +77,12 @@ public async Task> Effect(int effect_id) /// /// /// - public async Task> DynamicItem(int type_id, long item_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/dogma/dynamic/items/{type_id}/{item_id}/", + public async Task> DynamicItem(int type_id, long item_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/dogma/dynamic/items/{type_id}/{item_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "type_id", type_id.ToString() }, diff --git a/ESI.NET/Logic/FactionWarfareLogic.cs b/ESI.NET/Logic/FactionWarfareLogic.cs index 8d0b15b..dec9fa6 100644 --- a/ESI.NET/Logic/FactionWarfareLogic.cs +++ b/ESI.NET/Logic/FactionWarfareLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -31,50 +32,76 @@ public FactionWarfareLogic(HttpClient client, EsiConfig config, AuthorizedCharac /// /fw/wars/ /// /// - public async Task>> List() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/wars/"); + public async Task>> List(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/wars/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /fw/stats/ /// /// - public async Task>> Stats() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/stats/"); + public async Task>> Stats(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/stats/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /fw/systems/ /// /// - public async Task>> Systems() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/systems/"); + public async Task>> Systems(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/fw/systems/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// fw/leaderboards/ /// /// - public async Task>> Leaderboads() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/leaderboards/"); + public async Task>> Leaderboads(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/fw/leaderboards/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /fw/leaderboards/corporations/ /// /// - public async Task>> LeaderboardsForCorporations() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/leaderboards/corporations/"); + public async Task>> LeaderboardsForCorporations(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/fw/leaderboards/corporations/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /fw/leaderboards/characters/ /// /// - public async Task>> LeaderboardsForCharacters() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/fw/leaderboards/characters/"); + public async Task>> LeaderboardsForCharacters(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/fw/leaderboards/characters/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /corporations/{corporation_id}/fw/stats/ /// /// - public async Task> StatsForCorporation() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/fw/stats/", + public async Task> StatsForCorporation(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/fw/stats/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -85,8 +112,12 @@ public async Task> StatsForCorporation() /// /characters/{character_id}/fw/stats/ /// /// - public async Task> StatsForCharacter() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/fw/stats/", + public async Task> StatsForCharacter(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/fw/stats/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/FittingsLogic.cs b/ESI.NET/Logic/FittingsLogic.cs index 5e8a510..f708ff1 100644 --- a/ESI.NET/Logic/FittingsLogic.cs +++ b/ESI.NET/Logic/FittingsLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -28,8 +29,12 @@ public FittingsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /characters/{character_id}/fittings/ /// /// - public async Task>> List() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/fittings/", + public async Task>> List(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/fittings/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -41,8 +46,10 @@ public async Task>> List() /// /// /// - public async Task> Add(object fitting) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/fittings/", + public async Task> Add(object fitting, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/fittings/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -55,8 +62,10 @@ public async Task> Add(object fitting) /// /// /// - public async Task> Delete(int fitting_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/characters/{character_id}/fittings/{fitting_id}/", + public async Task> Delete(int fitting_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/characters/{character_id}/fittings/{fitting_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, diff --git a/ESI.NET/Logic/FleetsLogic.cs b/ESI.NET/Logic/FleetsLogic.cs index d316265..368ec7e 100644 --- a/ESI.NET/Logic/FleetsLogic.cs +++ b/ESI.NET/Logic/FleetsLogic.cs @@ -3,6 +3,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -30,8 +31,12 @@ public FleetsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /// /// - public async Task> Settings(long fleet_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/fleets/{fleet_id}/", + public async Task> Settings(long fleet_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/fleets/{fleet_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() } @@ -45,8 +50,11 @@ public async Task> Settings(long fleet_id) /// /// /// - public async Task> UpdateSettings(long fleet_id, string motd = null, bool? is_free_move = null) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/fleets/{fleet_id}/", + public async Task> UpdateSettings(long fleet_id, string motd = null, + bool? is_free_move = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/fleets/{fleet_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() } @@ -58,8 +66,11 @@ public async Task> UpdateSettings(long fleet_id, string motd /// /characters/{character_id}/fleet/ /// /// - public async Task> FleetInfo() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/fleet/", + public async Task> FleetInfo(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/fleet/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -71,8 +82,11 @@ public async Task> FleetInfo() /// /// /// - public async Task>> Members(long fleet_id) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/fleets/{fleet_id}/members/", + public async Task>> Members(long fleet_id, string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/fleets/{fleet_id}/members/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() } @@ -88,8 +102,11 @@ public async Task>> Members(long fleet_id) /// /// /// - public async Task> InviteCharacter(long fleet_id, int character_id, FleetRole role, long wing_id = 0, long squad_id = 0) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/fleets/{fleet_id}/members/", + public async Task> InviteCharacter(long fleet_id, int character_id, FleetRole role, + long wing_id = 0, long squad_id = 0, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/fleets/{fleet_id}/members/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() } @@ -106,8 +123,11 @@ public async Task> InviteCharacter(long fleet_id, int charac /// /// /// - public async Task> MoveCharacter(long fleet_id, int member_id, FleetRole role, long wing_id = 0, long squad_id = 0) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/fleets/{fleet_id}/members/{member_id}/", + public async Task> MoveCharacter(long fleet_id, int member_id, FleetRole role, + long wing_id = 0, long squad_id = 0, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/fleets/{fleet_id}/members/{member_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() }, @@ -122,8 +142,10 @@ public async Task> MoveCharacter(long fleet_id, int member_i /// /// /// - public async Task> KickCharacter(long fleet_id, int member_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/fleets/{fleet_id}/members/{member_id}/", + public async Task> KickCharacter(long fleet_id, int member_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/fleets/{fleet_id}/members/{member_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() }, @@ -136,8 +158,11 @@ public async Task> KickCharacter(long fleet_id, int member_i /// /// /// - public async Task>> Wings(long fleet_id) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/fleets/{fleet_id}/wings/", + public async Task>> Wings(long fleet_id, string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/fleets/{fleet_id}/wings/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() } @@ -149,8 +174,10 @@ public async Task>> Wings(long fleet_id) /// /// /// - public async Task> CreateWing(long fleet_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/fleets/{fleet_id}/wings/", + public async Task> CreateWing(long fleet_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/fleets/{fleet_id}/wings/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() } @@ -164,8 +191,10 @@ public async Task> CreateWing(long fleet_id) /// /// /// - public async Task> RenameWing(long fleet_id, long wing_id, string name) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/fleets/{fleet_id}/wings/{wing_id}/", + public async Task> RenameWing(long fleet_id, long wing_id, string name, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/fleets/{fleet_id}/wings/{wing_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() }, @@ -183,8 +212,10 @@ public async Task> RenameWing(long fleet_id, long wing_id, s /// /// /// - public async Task> DeleteWing(long fleet_id, long wing_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/fleets/{fleet_id}/wings/{wing_id}/", + public async Task> DeleteWing(long fleet_id, long wing_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/fleets/{fleet_id}/wings/{wing_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() }, @@ -198,8 +229,10 @@ public async Task> DeleteWing(long fleet_id, long wing_id) /// /// /// - public async Task> CreateSquad(long fleet_id, long wing_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/fleets/{fleet_id}/wings/{wing_id}/squads/", + public async Task> CreateSquad(long fleet_id, long wing_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/fleets/{fleet_id}/wings/{wing_id}/squads/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "fleet_id", fleet_id.ToString() }, @@ -214,15 +247,18 @@ public async Task> CreateSquad(long fleet_id, long wing_id /// /// /// - public async Task> RenameSquad(long fleet_id, long squad_id, string name) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/fleets/{fleet_id}/squads/{squad_id}/", replacements: new Dictionary() - { - { "fleet_id", fleet_id.ToString() }, - { "squad_id", squad_id.ToString() } - }, body: new - { - name - }, token: _data.Token); + public async Task> RenameSquad(long fleet_id, long squad_id, string name, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/fleets/{fleet_id}/squads/{squad_id}/", + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "fleet_id", fleet_id.ToString() }, + { "squad_id", squad_id.ToString() } + }, body: new + { + name + }, token: _data.Token); /// /// /fleets/{fleet_id}/squads/{squad_id}/ @@ -230,13 +266,16 @@ public async Task> RenameSquad(long fleet_id, long squad_id, /// /// /// - public async Task> DeleteSquad(long fleet_id, long squad_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/fleets/{fleet_id}/squads/{squad_id}/", replacements: new Dictionary() - { - { "fleet_id", fleet_id.ToString() }, - { "squad_id", squad_id.ToString() } - }, token: _data.Token); - + public async Task> DeleteSquad(long fleet_id, long squad_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/fleets/{fleet_id}/squads/{squad_id}/", + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "fleet_id", fleet_id.ToString() }, + { "squad_id", squad_id.ToString() } + }, token: _data.Token); + /// /// /// diff --git a/ESI.NET/Logic/IncursionsLogic.cs b/ESI.NET/Logic/IncursionsLogic.cs index 29c1b23..2a15874 100644 --- a/ESI.NET/Logic/IncursionsLogic.cs +++ b/ESI.NET/Logic/IncursionsLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Models.Incursions; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -11,13 +12,20 @@ public class IncursionsLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public IncursionsLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public IncursionsLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /incursions/ /// /// - public async Task>> All() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/incursions/"); + public async Task>> All(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/incursions/", + eTag: eTag, + cancellationToken: cancellationToken); } } \ No newline at end of file diff --git a/ESI.NET/Logic/IndustryLogic.cs b/ESI.NET/Logic/IndustryLogic.cs index bdc8848..d8ef313 100644 --- a/ESI.NET/Logic/IndustryLogic.cs +++ b/ESI.NET/Logic/IndustryLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -31,23 +32,35 @@ public IndustryLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /industry/facilities/ /// /// - public async Task>> Facilities() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/industry/facilities/"); + public async Task>> Facilities(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/industry/facilities/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /industry/systems/ /// /// - public async Task>> SolarSystemCostIndices() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/industry/systems/"); + public async Task>> SolarSystemCostIndices(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/industry/systems/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /characters/{character_id}/industry/jobs/ /// /// /// - public async Task>> JobsForCharacter(bool include_completed = false) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/industry/jobs/", + public async Task>> JobsForCharacter(bool include_completed = false, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/industry/jobs/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -63,8 +76,12 @@ public async Task>> JobsForCharacter(bool include_complete /// /// /// - public async Task>> MiningLedger(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/mining/", + public async Task>> MiningLedger(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/mining/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -80,8 +97,12 @@ public async Task>> MiningLedger(int page = 1) /// /// /// - public async Task>> Observers(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporation/{corporation_id}/mining/observers/", + public async Task>> Observers(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporation/{corporation_id}/mining/observers/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -98,8 +119,13 @@ public async Task>> Observers(int page = 1) /// /// /// - public async Task>> ObservedMining(long observer_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporation/{corporation_id}/mining/observers/{observer_id}/", + public async Task>> ObservedMining(long observer_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporation/{corporation_id}/mining/observers/{observer_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() }, @@ -117,8 +143,13 @@ public async Task>> ObservedMining(long observer_ /// /// /// - public async Task>> JobsForCorporation(bool include_completed = false, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/industry/jobs/", + public async Task>> JobsForCorporation(bool include_completed = false, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/industry/jobs/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -134,8 +165,12 @@ public async Task>> JobsForCorporation(bool include_comple /// /corporation/{corporation_id}/mining/extractions/ /// /// - public async Task>> Extractions() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporation/{corporation_id}/mining/extractions/", + public async Task>> Extractions(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporation/{corporation_id}/mining/extractions/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } diff --git a/ESI.NET/Logic/InsuranceLogic.cs b/ESI.NET/Logic/InsuranceLogic.cs index 27d6165..3dc8848 100644 --- a/ESI.NET/Logic/InsuranceLogic.cs +++ b/ESI.NET/Logic/InsuranceLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Models.Insurance; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -11,13 +12,21 @@ public class InsuranceLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public InsuranceLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public InsuranceLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /insurance/prices/ /// /// - public async Task>> Levels() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/insurance/prices/"); + public async Task>> Levels(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/insurance/prices/", + eTag: eTag, + cancellationToken: cancellationToken); } } \ No newline at end of file diff --git a/ESI.NET/Logic/KillmailsLogic.cs b/ESI.NET/Logic/KillmailsLogic.cs index 272338a..5ea3588 100644 --- a/ESI.NET/Logic/KillmailsLogic.cs +++ b/ESI.NET/Logic/KillmailsLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -32,8 +33,12 @@ public KillmailsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDa /// /// /// - public async Task>> ForCharacter(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/killmails/recent/", + public async Task>> ForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/killmails/recent/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -49,8 +54,12 @@ public async Task>> ForCharacter(int page = 1) /// /// /// - public async Task>> ForCorporation(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/killmails/recent/", + public async Task>> ForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/killmails/recent/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -67,8 +76,13 @@ public async Task>> ForCorporation(int page = 1) /// The killmail hash for verification /// The killmail ID to be queried /// - public async Task> Information(string killmail_hash, int killmail_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/killmails/{killmail_id}/{killmail_hash}/", + public async Task> Information(string killmail_hash, int killmail_id, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/killmails/{killmail_id}/{killmail_hash}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "killmail_id", killmail_id.ToString() }, diff --git a/ESI.NET/Logic/LocationLogic.cs b/ESI.NET/Logic/LocationLogic.cs index 0583c5a..1c57942 100644 --- a/ESI.NET/Logic/LocationLogic.cs +++ b/ESI.NET/Logic/LocationLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -28,8 +29,11 @@ public LocationLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /characters/{character_id}/location/ /// /// - public async Task> Location() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/location/", + public async Task> Location(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/location/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -40,8 +44,11 @@ public async Task> Location() /// /characters/{character_id}/ship/ /// /// - public async Task> Ship() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/ship/", + public async Task> Ship(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/ship/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -52,8 +59,11 @@ public async Task> Ship() /// /characters/{character_id}/online/ /// /// - public async Task> Online() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/online/", + public async Task> Online(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/online/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/LoyaltyLogic.cs b/ESI.NET/Logic/LoyaltyLogic.cs index 7c2e312..ee9ce5a 100644 --- a/ESI.NET/Logic/LoyaltyLogic.cs +++ b/ESI.NET/Logic/LoyaltyLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -28,8 +29,12 @@ public LoyaltyLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /loyalty/stores/{corporation_id}/offers/ /// /// - public async Task>> Offers(int corporation_id) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/loyalty/stores/{corporation_id}/offers/", + public async Task>> Offers(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/loyalty/stores/{corporation_id}/offers/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -39,8 +44,12 @@ public async Task>> Offers(int corporation_id) /// /characters/{character_id}/loyalty/points/ /// /// - public async Task>> Points() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/loyalty/points/", + public async Task>> Points(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/loyalty/points/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/MailLogic.cs b/ESI.NET/Logic/MailLogic.cs index e708dd9..b3ba0bd 100644 --- a/ESI.NET/Logic/MailLogic.cs +++ b/ESI.NET/Logic/MailLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -28,7 +29,9 @@ public MailLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData da /// /characters/{character_id}/mail/ /// /// - public async Task>> Headers(long[] labels = null, int last_mail_id = 0) + public async Task>> Headers(long[] labels = null, int last_mail_id = 0, + string eTag = null, + CancellationToken cancellationToken = default) { var parameters = new List(); @@ -38,7 +41,10 @@ public async Task>> Headers(long[] labels = null, int l if (last_mail_id > 0) parameters.Add($"last_mail_id={last_mail_id}"); - var response = await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/mail/", + var response = await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/mail/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -57,8 +63,11 @@ public async Task>> Headers(long[] labels = null, int l /// /// /// - public async Task> New(object[] recipients, string subject, string body, int approved_cost = 0) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/mail/", + public async Task> New(object[] recipients, string subject, string body, int approved_cost = 0, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/mail/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -76,8 +85,12 @@ public async Task> New(object[] recipients, string subject, str /// /characters/{character_id}/mail/labels/ /// /// - public async Task> Labels() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/mail/labels/", + public async Task> Labels(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/mail/labels/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -90,8 +103,11 @@ public async Task> Labels() /// /// /// - public async Task> NewLabel(string name, string color) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/mail/labels/", + public async Task> NewLabel(string name, string color, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/characters/{character_id}/mail/labels/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -108,8 +124,10 @@ public async Task> NewLabel(string name, string color) /// /// /// - public async Task> DeleteLabel(long label_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/characters/{character_id}/mail/labels/{label_id}/", + public async Task> DeleteLabel(long label_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/characters/{character_id}/mail/labels/{label_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -121,8 +139,12 @@ public async Task> DeleteLabel(long label_id) /// /characters/{character_id}/mail/lists/ /// /// - public async Task>> MailingLists() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/mail/lists/", + public async Task>> MailingLists(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/mail/lists/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -134,8 +156,12 @@ public async Task>> MailingLists() /// /// /// - public async Task> Retrieve(int mail_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/mail/{mail_id}/", + public async Task> Retrieve(int mail_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/mail/{mail_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -150,8 +176,10 @@ public async Task> Retrieve(int mail_id) /// /// /// - public async Task> Update(int mail_id, bool? is_read = null, int[] labels = null) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/characters/{character_id}/mail/{mail_id}/", + public async Task> Update(int mail_id, bool? is_read = null, int[] labels = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, + "/characters/{character_id}/mail/{mail_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -159,14 +187,16 @@ public async Task> Update(int mail_id, bool? is_read = null }, body: BuildUpdateObject(is_read, labels), token: _data.Token); - + /// /// /characters/{character_id}/mail/{mail_id}/ /// /// /// - public async Task> Delete(int mail_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/characters/{character_id}/mail/{mail_id}/", + public async Task> Delete(int mail_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, + "/characters/{character_id}/mail/{mail_id}/", + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, diff --git a/ESI.NET/Logic/MarketLogic.cs b/ESI.NET/Logic/MarketLogic.cs index 08cea6f..d21ef82 100644 --- a/ESI.NET/Logic/MarketLogic.cs +++ b/ESI.NET/Logic/MarketLogic.cs @@ -3,6 +3,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -15,7 +16,8 @@ public class MarketLogic private readonly AuthorizedCharacterData _data; private readonly int character_id, corporation_id; - public MarketLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData data = null) + public MarketLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData data = null, string eTag = null, + CancellationToken cancellationToken = default) { _client = client; _config = config; @@ -32,8 +34,11 @@ public MarketLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /markets/prices/ /// /// - public async Task>> Prices() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/prices/"); + public async Task>> Prices(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/prices/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /markets/{region_id}/orders/ @@ -44,10 +49,12 @@ public async Task>> Prices() /// /// public async Task>> RegionOrders( - int region_id, - MarketOrderType order_type = MarketOrderType.All, - int page = 1, - int? type_id = null) + int region_id, + MarketOrderType order_type = MarketOrderType.All, + int page = 1, + int? type_id = null, + string eTag = null, + CancellationToken cancellationToken = default) { var parameters = new List() { $"order_type={order_type.ToEsiValue()}" }; parameters.Add($"page={page}"); @@ -55,7 +62,10 @@ public async Task>> RegionOrders( if (type_id != null) parameters.Add($"type_id={type_id}"); - var response = await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/{region_id}/orders/", + var response = await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/markets/{region_id}/orders/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "region_id", region_id.ToString() } @@ -71,8 +81,12 @@ public async Task>> RegionOrders( /// /// /// - public async Task>> TypeHistoryInRegion(int region_id, int type_id) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/{region_id}/history/", + public async Task>> TypeHistoryInRegion(int region_id, int type_id, + string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/markets/{region_id}/history/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "region_id", region_id.ToString() } @@ -88,8 +102,12 @@ public async Task>> TypeHistoryInRegion(int region_i /// /// /// - public async Task>> StructureOrders(long structure_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/markets/structures/{structure_id}/", + public async Task>> StructureOrders(long structure_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/markets/structures/{structure_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "structure_id", structure_id.ToString() } @@ -104,16 +122,22 @@ public async Task>> StructureOrders(long structure_id, i /// /markets/groups/ /// /// - public async Task> Groups() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/groups/"); + public async Task> Groups(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/groups/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /markets/groups/{market_group_id}/ /// /// /// - public async Task> Group(int market_group_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/groups/{market_group_id}/", + public async Task> Group(int market_group_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/markets/groups/{market_group_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "market_group_id", market_group_id.ToString() } @@ -123,8 +147,12 @@ public async Task> Group(int market_group_id) /// /characters/{character_id}/orders/ /// /// - public async Task>> CharacterOrders() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/orders/", + public async Task>> CharacterOrders(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/orders/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -136,8 +164,12 @@ public async Task>> CharacterOrders() /// /// /// - public async Task>> CharacterOrderHistory(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/orders/history/", + public async Task>> CharacterOrderHistory(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/orders/history/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -154,8 +186,12 @@ public async Task>> CharacterOrderHistory(int page = 1) /// /// /// - public async Task> Types(int region_id, int page = 1) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/markets/{region_id}/types/", + public async Task> Types(int region_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/markets/{region_id}/types/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "region_id", region_id.ToString() } @@ -170,8 +206,12 @@ public async Task> Types(int region_id, int page = 1) /// /// /// - public async Task>> CorporationOrders(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/orders/", + public async Task>> CorporationOrders(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/orders/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -187,8 +227,12 @@ public async Task>> CorporationOrders(int page = 1) /// /// /// - public async Task>> CorporationOrderHistory(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/orders/history/", + public async Task>> CorporationOrderHistory(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/orders/history/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } diff --git a/ESI.NET/Logic/OpportunitiesLogic.cs b/ESI.NET/Logic/OpportunitiesLogic.cs index 08fcc05..9af9ba8 100644 --- a/ESI.NET/Logic/OpportunitiesLogic.cs +++ b/ESI.NET/Logic/OpportunitiesLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; using opportunities = ESI.NET.Models.Opportunities; @@ -13,7 +14,7 @@ public class OpportunitiesLogic private readonly EsiConfig _config; private readonly AuthorizedCharacterData _data; private readonly int character_id; - + public OpportunitiesLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData data = null) { _client = client; @@ -28,16 +29,22 @@ public OpportunitiesLogic(HttpClient client, EsiConfig config, AuthorizedCharact /// /opportunities/groups/ /// /// - public async Task> Groups() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/opportunities/groups/"); + public async Task> Groups(string eTag = null, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/opportunities/groups/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /opportunities/groups/{group_id}/ /// /// /// - public async Task> Group(int group_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/opportunities/groups/{group_id}/", + public async Task> Group(int group_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/opportunities/groups/{group_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "group_id", group_id.ToString() } @@ -47,16 +54,23 @@ public async Task> Groups() /// /opportunities/tasks/ /// /// - public async Task> Tasks() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/opportunities/tasks/"); + public async Task> Tasks(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/opportunities/tasks/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /opportunities/tasks/{task_id}/ /// /// /// - public async Task> Task(int task_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/opportunities/tasks/{task_id}/", + public async Task> Task(int task_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/opportunities/tasks/{task_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "task_id", task_id.ToString() } @@ -67,8 +81,12 @@ public async Task> Tasks() /// /// /// - public async Task>> CompletedTasks() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/opportunities/", + public async Task>> CompletedTasks(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, + HttpMethod.Get, "/characters/{character_id}/opportunities/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/PlanetaryInteractionLogic.cs b/ESI.NET/Logic/PlanetaryInteractionLogic.cs index d20afed..9a692d4 100644 --- a/ESI.NET/Logic/PlanetaryInteractionLogic.cs +++ b/ESI.NET/Logic/PlanetaryInteractionLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -31,8 +32,11 @@ public PlanetaryInteractionLogic(HttpClient client, EsiConfig config, Authorized /// /characters/{character_id}/planets/ /// /// - public async Task>> Colonies() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/planets/", + public async Task>> Colonies(string eTag = null, CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/planets/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -44,8 +48,12 @@ public async Task>> Colonies() /// /// /// - public async Task> ColonyLayout(int planet_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/planets/{planet_id}/", + public async Task> ColonyLayout(int planet_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/planets/{planet_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() }, @@ -57,8 +65,12 @@ public async Task> ColonyLayout(int planet_id) /// /corporations/{corporation_id}/customs_offices/ /// /// - public async Task>> CorporationCustomsOffices() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/customs_offices/", + public async Task>> CorporationCustomsOffices(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/customs_offices/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -70,8 +82,12 @@ public async Task>> CorporationCustomsOffices() /// /// /// - public async Task> SchematicInformation(int schematic_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/schematics/{schematic_id}/", + public async Task> SchematicInformation(int schematic_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/schematics/{schematic_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "schematic_id", schematic_id.ToString() } diff --git a/ESI.NET/Logic/RoutesLogic.cs b/ESI.NET/Logic/RoutesLogic.cs index 231120b..a69667a 100644 --- a/ESI.NET/Logic/RoutesLogic.cs +++ b/ESI.NET/Logic/RoutesLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Enumerations; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -11,7 +12,11 @@ public class RoutesLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public RoutesLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public RoutesLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /route/{origin}/{destination}/ @@ -23,11 +28,13 @@ public class RoutesLogic /// /// public async Task> Map( - int origin, - int destination, - RoutesFlag flag = RoutesFlag.Shortest, - int[] avoid = null, - int[] connections = null) + int origin, + int destination, + RoutesFlag flag = RoutesFlag.Shortest, + int[] avoid = null, + int[] connections = null, + string eTag = null, + CancellationToken cancellationToken = default) { var parameters = new List() { $"flag={flag.ToEsiValue()}" }; @@ -37,7 +44,10 @@ public async Task> Map( if (connections != null) parameters.Add($"&connections={string.Join(",", connections)}"); - var response = await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/route/{origin}/{destination}/", + var response = await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/route/{origin}/{destination}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "origin", origin.ToString() }, diff --git a/ESI.NET/Logic/SearchLogic.cs b/ESI.NET/Logic/SearchLogic.cs index 27f5f2d..083fe45 100644 --- a/ESI.NET/Logic/SearchLogic.cs +++ b/ESI.NET/Logic/SearchLogic.cs @@ -3,6 +3,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -33,7 +34,8 @@ public SearchLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// Whether the search should be a strict match /// Language to use in the response /// - public async Task> Query(SearchType type, string search, SearchCategory categories, bool isStrict = false, string language = "en-us") + public async Task> Query(SearchType type, string search, SearchCategory categories, + bool isStrict = false, string language = "en-us", string eTag = null, CancellationToken cancellationToken = default) { var categoryList = categories.ToEsiValue(); @@ -50,15 +52,21 @@ public async Task> Query(SearchType type, string sear endpoint = "/characters/{character_id}/search/"; } - var response = await Execute(_client, _config, security, HttpMethod.Get, endpoint, replacements, parameters: new string[] { - $"search={search}", - $"categories={categoryList}", - $"strict={isStrict}", - $"language={language}" - }, - token: _data?.Token); + var response = await Execute(_client, _config, security, HttpMethod.Get, + endpoint: endpoint, + eTag: eTag, + cancellationToken: cancellationToken, + replacements: replacements, + parameters: new string[] + { + $"search={search}", + $"categories={categoryList}", + $"strict={isStrict}", + $"language={language}" + }, + token: _data?.Token); return response; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Logic/SkillsLogic.cs b/ESI.NET/Logic/SkillsLogic.cs index 57cca3e..ed84cb7 100644 --- a/ESI.NET/Logic/SkillsLogic.cs +++ b/ESI.NET/Logic/SkillsLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.SSO; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -28,8 +29,12 @@ public SkillsLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /characters/{character_id}/attributes/ /// /// - public async Task> Attributes() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/attributes/", + public async Task> Attributes(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/attributes/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -40,8 +45,12 @@ public async Task> Attributes() /// /characters/{character_id}/skills/ /// /// - public async Task> List() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/skills/", + public async Task> List(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/skills/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -52,8 +61,12 @@ public async Task> List() /// /characters/{character_id}/skillqueue/ /// /// - public async Task>> Queue() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/skillqueue/", + public async Task>> Queue(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/skillqueue/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } diff --git a/ESI.NET/Logic/SovereigntyLogic.cs b/ESI.NET/Logic/SovereigntyLogic.cs index 08e7f3d..2829200 100644 --- a/ESI.NET/Logic/SovereigntyLogic.cs +++ b/ESI.NET/Logic/SovereigntyLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Models.Sovereignty; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -11,27 +12,43 @@ public class SovereigntyLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public SovereigntyLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public SovereigntyLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /sovereignty/campaigns/ /// /// - public async Task>> Campaigns() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/sovereignty/campaigns/"); + public async Task>> Campaigns(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/sovereignty/campaigns/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /sovereignty/map/ /// /// - public async Task>> Systems() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/sovereignty/map/"); + public async Task>> Systems(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/sovereignty/map/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /sovereignty/structures/ /// /// - public async Task>> Structures() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/sovereignty/structures/"); + public async Task>> Structures(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/sovereignty/structures/", + eTag: eTag, + cancellationToken: cancellationToken); } } \ No newline at end of file diff --git a/ESI.NET/Logic/StatusLogic.cs b/ESI.NET/Logic/StatusLogic.cs index 282b0dd..fd04f45 100644 --- a/ESI.NET/Logic/StatusLogic.cs +++ b/ESI.NET/Logic/StatusLogic.cs @@ -1,5 +1,6 @@ using ESI.NET.Models.Status; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -10,9 +11,16 @@ public class StatusLogic private readonly HttpClient _client; private readonly EsiConfig _config; - public StatusLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + public StatusLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } - public async Task> Retrieve() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/status/"); + public async Task> Retrieve(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/status/", + eTag: eTag, + cancellationToken: cancellationToken); } } \ No newline at end of file diff --git a/ESI.NET/Logic/UniverseLogic.cs b/ESI.NET/Logic/UniverseLogic.cs index b4eaf33..efd9822 100644 --- a/ESI.NET/Logic/UniverseLogic.cs +++ b/ESI.NET/Logic/UniverseLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.Universe; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -24,77 +25,109 @@ public UniverseLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /universe/bloodlines/ /// /// - public async Task>> Bloodlines() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/bloodlines/"); + public async Task>> Bloodlines(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/bloodlines/", + eTag: eTag, cancellationToken: cancellationToken ); /// /// /universe/categories/ /// /// - public async Task> Categories() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/categories/"); + public async Task> Categories(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/categories/", + eTag: eTag, cancellationToken: cancellationToken); /// /// /universe/categories/{category_id}/ /// /// /// - public async Task> Category(int category_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/categories/{category_id}/", replacements: new Dictionary() - { - { "category_id", category_id.ToString() } - }); + public async Task> Category(int category_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/categories/{category_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "category_id", category_id.ToString() } + }); /// /// /universe/constellations/ /// /// - public async Task> Constellations() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/constellations/"); + public async Task> Constellations(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/constellations/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/constellations/{constellation_id}/ /// /// /// - public async Task> Constellation(int constellation_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/constellations/{constellation_id}/", replacements: new Dictionary() - { - { "constellation_id", constellation_id.ToString() } - }); + public async Task> Constellation(int constellation_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/constellations/{constellation_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() + { + { "constellation_id", constellation_id.ToString() } + }); /// /// /universe/factions/ /// /// - public async Task>> Factions() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/factions/"); + public async Task>> Factions(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/factions/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/graphics/ /// /// - public async Task> Graphics() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/graphics/"); + public async Task> Graphics(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/graphics/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/graphics/{graphic_id}/ /// /// /// - public async Task> Graphic(int graphic_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/graphics/{graphic_id}/", replacements: new Dictionary() - { - { "graphic_id", graphic_id.ToString() } - }); + public async Task> Graphic(int graphic_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/graphics/{graphic_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() + { + { "graphic_id", graphic_id.ToString() } + }); /// /// /universe/groups/ /// /// /// - public async Task> Groups(int page = 1) + public async Task> Groups(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/groups/", + eTag: eTag, + cancellationToken: cancellationToken, parameters: new string[] { $"page={page}" @@ -105,129 +138,185 @@ public async Task> Groups(int page = 1) /// /// /// - public async Task> Group(int group_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/groups/{group_id}/", replacements: new Dictionary() - { - { "group_id", group_id.ToString() } - }); + public async Task> Group(int group_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/groups/{group_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() + { + { "group_id", group_id.ToString() } + }); /// /// /universe/moons/{moon_id}/ /// /// /// - public async Task> Moon(int moon_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/moons/{moon_id}/", replacements: new Dictionary() - { - { "moon_id", moon_id.ToString() } - }); + public async Task> Moon(int moon_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/moons/{moon_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "moon_id", moon_id.ToString() } + }); /// /// /universe/names/ /// /// The ids to resolve; Supported IDs for resolving are: Characters, Corporations, Alliances, Stations, Solar Systems, Constellations, Regions, Types. /// - public async Task>> Names(List any_ids) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Post, "/universe/names/", body: any_ids.ToArray()); + public async Task>> Names(List any_ids, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Post, + "/universe/names/", + cancellationToken: cancellationToken, + body: any_ids.ToArray()); /// /// /universe/ids/ /// /// Resolve a set of names to IDs in the following categories: agents, alliances, characters, constellations, corporations factions, inventory_types, regions, stations, and systems. Only exact matches will be returned. All names searched for are cached for 12 hours. /// - public async Task> IDs(List names) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Post, "/universe/ids/", body: names.ToArray()); + public async Task> IDs(List names, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Post, "/universe/ids/", + cancellationToken: cancellationToken, + body: names.ToArray()); /// /// /universe/planets/{planet_id}/ /// /// /// - public async Task> Planet(int planet_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/planets/{planet_id}/", replacements: new Dictionary() - { - { "planet_id", planet_id.ToString() } - }); + public async Task> Planet(int planet_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/planets/{planet_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "planet_id", planet_id.ToString() } + }); /// /// /universe/races/ /// /// - public async Task>> Races() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/races/"); + public async Task>> Races(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/races/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/regions/ /// /// - public async Task> Regions() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/regions/"); + public async Task> Regions(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/regions/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/regions/{region_id}/ /// /// /// - public async Task> Region(int region_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/regions/{region_id}/", replacements: new Dictionary() - { - { "region_id", region_id.ToString() } - }); + public async Task> Region(int region_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/regions/{region_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "region_id", region_id.ToString() } + }); /// /// /universe/stations/{station_id}/ /// /// /// - public async Task> Station(int station_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/stations/{station_id}/", replacements: new Dictionary() - { - { "station_id", station_id.ToString() } - }); + public async Task> Station(int station_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/stations/{station_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "station_id", station_id.ToString() } + }); /// /// /universe/structures/ /// /// - public async Task> Structures() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/structures/"); + public async Task> Structures(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/structures/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/structures/{structure_id}/ /// /// /// - public async Task> Structure(long structure_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/universe/structures/{structure_id}/", replacements: new Dictionary() - { - { "structure_id", structure_id.ToString() } - }, token: _data.Token); + public async Task> Structure(long structure_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/universe/structures/{structure_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "structure_id", structure_id.ToString() } + }, token: _data.Token); /// /// /universe/systems/ /// /// - public async Task> Systems() - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/systems/"); + public async Task> Systems(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/systems/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/systems/{system_id}/ /// /// /// - public async Task> System(int system_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/systems/{system_id}/", replacements: new Dictionary() - { - { "system_id", system_id.ToString() } - }); + public async Task> System(int system_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/systems/{system_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "system_id", system_id.ToString() } + }); /// /// /universe/types/ /// /// /// - public async Task> Types(int page = 1) + public async Task> Types(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/types/", + eTag: eTag, + cancellationToken: cancellationToken, parameters: new string[] { $"page={page}" @@ -238,63 +327,94 @@ public async Task> Types(int page = 1) /// /// /// - public async Task> Type(int type_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/types/{type_id}/", replacements: new Dictionary() - { - { "type_id", type_id.ToString() } - }); + public async Task> Type(int type_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/types/{type_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "type_id", type_id.ToString() } + }); /// /// /universe/stargates/{stargate_id}/ /// /// /// - public async Task> Stargate(int stargate_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/stargates/{stargate_id}/", replacements: new Dictionary() - { - { "stargate_id", stargate_id.ToString() } - }); + public async Task> Stargate(int stargate_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/stargates/{stargate_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "stargate_id", stargate_id.ToString() } + }); /// /// /universe/system_jumps/ /// /// - public async Task>> Jumps() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/system_jumps/"); + public async Task>> Jumps(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/system_jumps/", + eTag: eTag, + cancellationToken: cancellationToken); /// /// /universe/system_kills/ /// /// - public async Task>> Kills() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/system_kills/"); + public async Task>> Kills(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/system_kills/", eTag: eTag, cancellationToken: cancellationToken); /// /// /universe/stars/{star_id}/ /// /// /// - public async Task> Star(int star_id) - => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/stars/{star_id}/", replacements: new Dictionary() - { - { "star_id", star_id.ToString() } - }); + public async Task> Star(int star_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/stars/{star_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "star_id", star_id.ToString() } + }); /// /// /universe/ancestries/ /// /// - public async Task>> Ancestries() - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/ancestries/"); + public async Task>> Ancestries(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/ancestries/", + eTag: eTag, + cancellationToken: cancellationToken + ); /// /// /universe/asteroid_belts/{asteroid_belt_id}/ /// /// - public async Task>> AsteroidBelt(int asteroid_belt_id) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/asteroid_belts/{asteroid_belt_id}/", replacements: new Dictionary() - { - { "asteroid_belt_id", asteroid_belt_id.ToString() } - }); + public async Task>> AsteroidBelt(int asteroid_belt_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/universe/asteroid_belts/{asteroid_belt_id}/", + eTag: eTag, + cancellationToken: cancellationToken, + replacements: new Dictionary() + { + { "asteroid_belt_id", asteroid_belt_id.ToString() } + }); } -} +} \ No newline at end of file diff --git a/ESI.NET/Logic/UserInterfaceLogic.cs b/ESI.NET/Logic/UserInterfaceLogic.cs index d9e7ac5..2d6d4e5 100644 --- a/ESI.NET/Logic/UserInterfaceLogic.cs +++ b/ESI.NET/Logic/UserInterfaceLogic.cs @@ -1,4 +1,5 @@ using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using ESI.NET.Models.SSO; using static ESI.NET.EsiRequest; @@ -23,8 +24,10 @@ public UserInterfaceLogic(HttpClient client, EsiConfig config, AuthorizedCharact /// /// /// - public async Task> MarketDetails(int type_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/ui/openwindow/marketdetails/", + public async Task> MarketDetails(int type_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/ui/openwindow/marketdetails/", + cancellationToken: cancellationToken, parameters: new string[] { $"type_id={type_id}" @@ -36,8 +39,10 @@ public async Task> MarketDetails(int type_id) /// /// /// - public async Task> Contract(int contract_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/ui/openwindow/contract/", + public async Task> Contract(int contract_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/ui/openwindow/contract/", + cancellationToken: cancellationToken, parameters: new string[] { $"contract_id={contract_id}" @@ -49,8 +54,10 @@ public async Task> Contract(int contract_id) /// /// /// - public async Task> Information(int target_id) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/ui/openwindow/information/", + public async Task> Information(int target_id, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/ui/openwindow/information/", + cancellationToken: cancellationToken, parameters: new string[] { $"target_id={target_id}" @@ -64,8 +71,11 @@ public async Task> Information(int target_id) /// /// /// - public async Task> Waypoint(long destination_id, bool add_to_beginning = false, bool clear_other_waypoints = false) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/ui/autopilot/waypoint/", + public async Task> Waypoint(long destination_id, bool add_to_beginning = false, + bool clear_other_waypoints = false, CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/ui/autopilot/waypoint/", + cancellationToken: cancellationToken, parameters: new string[] { $"destination_id={destination_id}", @@ -83,8 +93,11 @@ public async Task> Waypoint(long destination_id, bool add_to /// /// /// - public async Task> NewMail(string subject, string body, int[] recipients) - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/ui/openwindow/newmail/", + public async Task> NewMail(string subject, string body, int[] recipients, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, + "/ui/openwindow/newmail/", + cancellationToken: cancellationToken, body: new { subject, diff --git a/ESI.NET/Logic/WalletLogic.cs b/ESI.NET/Logic/WalletLogic.cs index 47a6a5a..2c77423 100644 --- a/ESI.NET/Logic/WalletLogic.cs +++ b/ESI.NET/Logic/WalletLogic.cs @@ -2,6 +2,7 @@ using ESI.NET.Models.Wallet; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -31,19 +32,27 @@ public WalletLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// /characters/{character_id}/wallet/ /// /// - public async Task> CharacterWallet() - => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/wallet/", replacements: new Dictionary() - { - { "character_id", character_id.ToString() } - }, token: _data.Token); + public async Task> CharacterWallet(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/wallet/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() + { + { "character_id", character_id.ToString() } + }, token: _data.Token); /// /// /characters/{character_id}/wallet/journal/ /// /// /// - public async Task>> CharacterJournal(int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/wallet/journal/", + public async Task>> CharacterJournal(int page = 1, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/wallet/journal/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -60,8 +69,12 @@ public async Task>> CharacterJournal(int page = 1 /// /// /// - public async Task>> CharacterTransactions(long from_id) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/wallet/transactions/", + public async Task>> CharacterTransactions(long from_id, string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/characters/{character_id}/wallet/transactions/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "character_id", character_id.ToString() } @@ -76,8 +89,12 @@ public async Task>> CharacterTransactions(long fro /// /corporations/{corporation_id}/wallets/ /// /// - public async Task>> CorporationWallets() - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/wallets/", + public async Task>> CorporationWallets(string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/wallets/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() } @@ -90,8 +107,13 @@ public async Task>> CorporationWallets() /// /// /// - public async Task>> CorporationJournal(int division, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/wallets/{division}/journal/", + public async Task>> CorporationJournal(int division, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/wallets/{division}/journal/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() }, @@ -109,8 +131,13 @@ public async Task>> CorporationJournal(int divisi /// /// /// - public async Task>> CorporationTransactions(int division, long from_id) - => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/wallets/{division}/transactions/", + public async Task>> CorporationTransactions(int division, long from_id, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, + "/corporations/{corporation_id}/wallets/{division}/transactions/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "corporation_id", corporation_id.ToString() }, diff --git a/ESI.NET/Logic/WarsLogic.cs b/ESI.NET/Logic/WarsLogic.cs index a947118..00fb765 100644 --- a/ESI.NET/Logic/WarsLogic.cs +++ b/ESI.NET/Logic/WarsLogic.cs @@ -1,6 +1,7 @@ using ESI.NET.Models.Wars; using System.Collections.Generic; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using static ESI.NET.EsiRequest; @@ -10,14 +11,20 @@ public class WarsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; - public WarsLogic(HttpClient client, EsiConfig config) { _client = client; _config = config; } + + public WarsLogic(HttpClient client, EsiConfig config) + { + _client = client; + _config = config; + } /// /// /wars/ /// /// Only return wars with ID smaller than this /// - public async Task> All(long max_war_id = 0) + public async Task> All(long max_war_id = 0, string eTag = null, + CancellationToken cancellationToken = default) { var parameters = new List(); @@ -25,6 +32,8 @@ public async Task> All(long max_war_id = 0) parameters.Add($"max_war_id={max_war_id}"); var response = await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/wars/", + eTag: eTag, + cancellationToken: cancellationToken, parameters: parameters.ToArray()); return response; @@ -35,8 +44,11 @@ public async Task> All(long max_war_id = 0) /// /// /// - public async Task> Information(int war_id) + public async Task> Information(int war_id, string eTag = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/wars/{war_id}/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "war_id", war_id.ToString() } @@ -48,8 +60,13 @@ public async Task> Information(int war_id) /// /// /// - public async Task>> Kills(int war_id, int page = 1) - => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/wars/{war_id}/killmails/", + public async Task>> Kills(int war_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default) + => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, + "/wars/{war_id}/killmails/", + eTag: eTag, + cancellationToken: cancellationToken, replacements: new Dictionary() { { "war_id", war_id.ToString() } diff --git a/ESI.NET/Logic/_SSOLogic.cs b/ESI.NET/Logic/_SSOLogic.cs index b5b8be2..9539b7f 100644 --- a/ESI.NET/Logic/_SSOLogic.cs +++ b/ESI.NET/Logic/_SSOLogic.cs @@ -12,6 +12,7 @@ using System.Net.Http.Headers; using System.Security.Cryptography; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace ESI.NET @@ -38,6 +39,7 @@ public SsoLogic(HttpClient client, EsiConfig config) _ssoUrl = "login.evepc.163.com"; break; } + _clientKey = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{config.ClientId}:{config.SecretKey}")); } @@ -49,9 +51,11 @@ public SsoLogic(HttpClient client, EsiConfig config) /// All hashing/encryption will be done automatically. Just provide the code. /// /// - public string CreateAuthenticationUrl(List scope = null, string state = null, string challengeCode = null) + public string CreateAuthenticationUrl(List scope = null, string state = null, + string challengeCode = null) { - var url = $"https://{_ssoUrl}/v2/oauth/authorize/?response_type=code&redirect_uri={Uri.EscapeDataString(_config.CallbackUrl)}&client_id={_config.ClientId}"; + var url = + $"https://{_ssoUrl}/v2/oauth/authorize/?response_type=code&redirect_uri={Uri.EscapeDataString(_config.CallbackUrl)}&client_id={_config.ClientId}"; if (scope != null) url = $"{url}&scope={string.Join("+", scope.Distinct().ToList())}"; @@ -65,7 +69,8 @@ public string CreateAuthenticationUrl(List scope = null, string state = using (var sha256 = SHA256.Create()) { - var base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(challengeCode)).TrimEnd('=').Replace('+', '-').Replace('/', '_'); + var base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(challengeCode)).TrimEnd('=') + .Replace('+', '-').Replace('/', '_'); var bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(base64)); var code_challenge = Convert.ToBase64String(bytes).TrimEnd('=').Replace('+', '-').Replace('/', '_'); @@ -75,7 +80,7 @@ public string CreateAuthenticationUrl(List scope = null, string state = return url; } - + public string GenerateChallengeCode() { const string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; @@ -89,7 +94,7 @@ public string GenerateChallengeCode() /// The authorization_code or the refresh_token /// Provide the same value that was provided for codeChallenge in CreateAuthenticationUrl(). All hashing/encryption will be done automatically. Just provide the code. /// - public async Task GetToken(GrantType grantType, string code, string codeChallenge = null) + public async Task GetToken(GrantType grantType, string code, string codeChallenge = null, CancellationToken cancellationToken = default) { var body = $"grant_type={grantType.ToEsiValue()}"; if (grantType == GrantType.AuthorizationCode) @@ -102,12 +107,12 @@ public async Task GetToken(GrantType grantType, string code, string co var base64 = Convert.ToBase64String(bytes).TrimEnd('=').Replace('+', '-').Replace('/', '_'); body += $"&code_verifier={base64}&client_id={_config.ClientId}"; } - } + } else if (grantType == GrantType.RefreshToken) { body += $"&refresh_token={Uri.EscapeDataString(code)}"; - if(codeChallenge != null) + if (codeChallenge != null) body += $"&client_id={_config.ClientId}"; } @@ -115,18 +120,19 @@ public async Task GetToken(GrantType grantType, string code, string co { Content = new StringContent(body, Encoding.UTF8, "application/x-www-form-urlencoded"), }; - if(codeChallenge == null) + if (codeChallenge == null) { request.Headers.Authorization = new AuthenticationHeaderValue("Basic", _clientKey); request.Headers.Host = _ssoUrl; } - var response = await _client.SendAsync(request); + var response = await _client.SendAsync(request, cancellationToken); var content = await response.Content.ReadAsStringAsync(); if (response.StatusCode != HttpStatusCode.OK) { - var error = JsonConvert.DeserializeAnonymousType(content, new { error_description = string.Empty }).error_description; + var error = JsonConvert.DeserializeAnonymousType(content, new { error_description = string.Empty }) + .error_description; throw new ArgumentException(error); } @@ -141,7 +147,7 @@ public async Task GetToken(GrantType grantType, string code, string co /// /// refresh_token to revoke /// - public async Task RevokeToken(string code) + public async Task RevokeToken(string code, CancellationToken cancellationToken = default) { var body = $"token_type_hint={GrantType.RefreshToken.ToEsiValue()}"; body += $"&token={Uri.EscapeDataString(code)}"; @@ -149,12 +155,13 @@ public async Task RevokeToken(string code) HttpContent postBody = new StringContent(body, Encoding.UTF8, "application/x-www-form-urlencoded"); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", _clientKey); - var response = await _client.PostAsync($"https://{_ssoUrl}/v2/oauth/revoke", postBody); + var response = await _client.PostAsync($"https://{_ssoUrl}/v2/oauth/revoke", postBody, cancellationToken); var content = await response.Content.ReadAsStringAsync(); if (response.StatusCode != HttpStatusCode.OK) { - var error = JsonConvert.DeserializeAnonymousType(content, new { error_description = string.Empty }).error_description; + var error = JsonConvert.DeserializeAnonymousType(content, new { error_description = string.Empty }) + .error_description; throw new ArgumentException(error); } } @@ -167,7 +174,7 @@ public async Task RevokeToken(string code) /// /// /// - public async Task Verify(SsoToken token) + public async Task Verify(SsoToken token, CancellationToken cancellationToken = default) { AuthorizedCharacterData authorizedCharacter = new AuthorizedCharacterData(); @@ -200,7 +207,7 @@ public async Task Verify(SsoToken token) var subjectClaim = jwtValidatedToken.Claims.SingleOrDefault(c => c.Type == "sub").Value; var nameClaim = jwtValidatedToken.Claims.SingleOrDefault(c => c.Type == "name").Value; var ownerClaim = jwtValidatedToken.Claims.SingleOrDefault(c => c.Type == "owner").Value; - + var returnedScopes = jwtValidatedToken.Claims.Where(c => c.Type == "scp"); var scopesClaim = string.Join(" ", returnedScopes.Select(s => s.Value)); @@ -213,15 +220,18 @@ public async Task Verify(SsoToken token) authorizedCharacter.Scopes = scopesClaim; // Get more specifc details about authorized character to be used in API calls that require this data about the character - var url = $"{_config.EsiUrl}latest/characters/affiliation/?datasource={_config.DataSource.ToEsiValue()}"; - var body = new StringContent(JsonConvert.SerializeObject(new int[] { authorizedCharacter.CharacterID }), Encoding.UTF8, "application/json"); + var url = + $"{_config.EsiUrl}latest/characters/affiliation/?datasource={_config.DataSource.ToEsiValue()}"; + var body = new StringContent(JsonConvert.SerializeObject(new int[] { authorizedCharacter.CharacterID }), + Encoding.UTF8, "application/json"); var client = new HttpClient(); - var characterResponse = await client.PostAsync(url, body).ConfigureAwait(false); + var characterResponse = await client.PostAsync(url, body, cancellationToken).ConfigureAwait(false); if (characterResponse.StatusCode == HttpStatusCode.OK) { - EsiResponse> affiliations = new EsiResponse>(characterResponse, "Post|/character/affiliations/"); + EsiResponse> affiliations = + new EsiResponse>(characterResponse, "Post|/character/affiliations/"); var characterData = affiliations.Data.First(); authorizedCharacter.AllianceID = characterData.AllianceId; @@ -237,4 +247,4 @@ public async Task Verify(SsoToken token) return authorizedCharacter; } } -} +} \ No newline at end of file From 97af8ba4265de965f7d4a66bb64308e95c821f30 Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 28 Aug 2024 22:04:18 +0200 Subject: [PATCH 2/4] Reverted ETag clearing after executing request. --- ESI.NET/EsiRequest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ESI.NET/EsiRequest.cs b/ESI.NET/EsiRequest.cs index ea78ca3..f68b700 100644 --- a/ESI.NET/EsiRequest.cs +++ b/ESI.NET/EsiRequest.cs @@ -52,6 +52,7 @@ public static async Task> Execute( if (eTag != null || ETag != null) { request.Headers.Add("If-None-Match", $"\"{eTag ?? ETag}\""); + ETag = null; } //Serialize post body data From da173d6ec693bf028b36b829d9fd278564b221ad Mon Sep 17 00:00:00 2001 From: Adrian Date: Sat, 14 Sep 2024 18:08:27 +0200 Subject: [PATCH 3/4] added interfaces to logic classes and reformated code --- ESI.NET/Enumerations/Contested.cs | 6 +- ESI.NET/Enumerations/ContractType.cs | 6 +- ESI.NET/Enumerations/DataSource.cs | 4 +- ESI.NET/Enumerations/EventResponse.cs | 6 +- ESI.NET/Enumerations/FleetRole.cs | 10 +- ESI.NET/Enumerations/GrantType.cs | 6 +- ESI.NET/Enumerations/MarketOrderType.cs | 8 +- ESI.NET/Enumerations/ResolvedInfoCategory.cs | 3 +- ESI.NET/Enumerations/RoutesFlag.cs | 8 +- ESI.NET/Enumerations/SearchCategory.cs | 24 +- ESI.NET/Enumerations/SearchType.cs | 2 +- ESI.NET/Enumerations/StructureServiceState.cs | 2 +- ESI.NET/Enumerations/StructureState.cs | 37 ++- ESI.NET/EsiClient.cs | 142 +++++------ ESI.NET/EsiConfig.cs | 2 +- ESI.NET/EsiRequest.cs | 6 +- ESI.NET/EsiResponse.cs | 8 +- ESI.NET/Extensions.cs | 5 +- ESI.NET/Interfaces/Logic/IAllianceLogic.cs | 40 +++ ESI.NET/Interfaces/Logic/IAssetsLogic.cs | 58 +++++ ESI.NET/Interfaces/Logic/IBookmarksLogic.cs | 38 +++ ESI.NET/Interfaces/Logic/ICalendarLogic.cs | 43 ++++ ESI.NET/Interfaces/Logic/ICharacterLogic.cs | 124 +++++++++ ESI.NET/Interfaces/Logic/IClonesLogic.cs | 23 ++ ESI.NET/Interfaces/Logic/IContactsLogic.cs | 83 ++++++ ESI.NET/Interfaces/Logic/IContractsLogic.cs | 82 ++++++ ESI.NET/Interfaces/Logic/ICorporationLogic.cs | 177 +++++++++++++ ESI.NET/Interfaces/Logic/IDogmaLogic.cs | 48 ++++ .../Interfaces/Logic/IFactionWarfareLogic.cs | 66 +++++ ESI.NET/Interfaces/Logic/IFittingsLogic.cs | 31 +++ ESI.NET/Interfaces/Logic/IFleetsLogic.cs | 138 ++++++++++ ESI.NET/Interfaces/Logic/IIncursionsLogic.cs | 17 ++ ESI.NET/Interfaces/Logic/IIndustryLogic.cs | 75 ++++++ ESI.NET/Interfaces/Logic/IInsuranceLogic.cs | 17 ++ ESI.NET/Interfaces/Logic/IKillmailsLogic.cs | 36 +++ ESI.NET/Interfaces/Logic/ILocationLogic.cs | 27 ++ ESI.NET/Interfaces/Logic/ILoyaltyLogic.cs | 24 ++ ESI.NET/Interfaces/Logic/IMailLogic.cs | 84 +++++++ ESI.NET/Interfaces/Logic/IMarketLogic.cs | 106 ++++++++ .../Interfaces/Logic/IOpportunitiesLogic.cs | 46 ++++ .../Logic/IPlanetaryInteractionLogic.cs | 39 +++ ESI.NET/Interfaces/Logic/IRoutesLogic.cs | 27 ++ ESI.NET/Interfaces/Logic/ISearchLogic.cs | 22 ++ ESI.NET/Interfaces/Logic/ISkillsLogic.cs | 31 +++ ESI.NET/Interfaces/Logic/ISovereigntyLogic.cs | 31 +++ ESI.NET/Interfaces/Logic/ISsoLogic.cs | 52 ++++ ESI.NET/Interfaces/Logic/IStatusLogic.cs | 12 + ESI.NET/Interfaces/Logic/IUniverseLogic.cs | 237 ++++++++++++++++++ .../Interfaces/Logic/IUserInterfaceLogic.cs | 51 ++++ ESI.NET/Interfaces/Logic/IWalletLogic.cs | 60 +++++ ESI.NET/Interfaces/Logic/IWarsLogic.cs | 36 +++ ESI.NET/Logic/AllianceLogic.cs | 9 +- ESI.NET/Logic/AssetsLogic.cs | 20 +- ESI.NET/Logic/BookmarksLogic.cs | 11 +- ESI.NET/Logic/CalendarLogic.cs | 17 +- ESI.NET/Logic/CharacterLogic.cs | 37 +-- ESI.NET/Logic/ClonesLogic.cs | 7 +- ESI.NET/Logic/ContactsLogic.cs | 27 +- ESI.NET/Logic/ContractsLogic.cs | 32 +-- ESI.NET/Logic/CorporationLogic.cs | 47 ++-- ESI.NET/Logic/DogmaLogic.cs | 9 +- ESI.NET/Logic/FactionWarfareLogic.cs | 7 +- ESI.NET/Logic/FittingsLogic.cs | 11 +- ESI.NET/Logic/FleetsLogic.cs | 84 ++++--- ESI.NET/Logic/IncursionsLogic.cs | 3 +- ESI.NET/Logic/IndustryLogic.cs | 17 +- ESI.NET/Logic/InsuranceLogic.cs | 5 +- ESI.NET/Logic/KillmailsLogic.cs | 11 +- ESI.NET/Logic/LocationLogic.cs | 15 +- ESI.NET/Logic/LoyaltyLogic.cs | 7 +- ESI.NET/Logic/MailLogic.cs | 38 +-- ESI.NET/Logic/MarketLogic.cs | 23 +- ESI.NET/Logic/OpportunitiesLogic.cs | 9 +- ESI.NET/Logic/PlanetaryInteractionLogic.cs | 16 +- ESI.NET/Logic/RoutesLogic.cs | 11 +- ESI.NET/Logic/SearchLogic.cs | 8 +- ESI.NET/Logic/SkillsLogic.cs | 9 +- ESI.NET/Logic/SovereigntyLogic.cs | 3 +- ESI.NET/Logic/StatusLogic.cs | 3 +- ESI.NET/Logic/UniverseLogic.cs | 33 +-- ESI.NET/Logic/UserInterfaceLogic.cs | 3 +- ESI.NET/Logic/WalletLogic.cs | 19 +- ESI.NET/Logic/WarsLogic.cs | 7 +- ESI.NET/Logic/_SSOLogic.cs | 12 +- ESI.NET/Models/Alliance/Alliance.cs | 18 +- ESI.NET/Models/Assets/Item.cs | 26 +- ESI.NET/Models/Assets/ItemLocation.cs | 14 +- ESI.NET/Models/Assets/ItemName.cs | 8 +- ESI.NET/Models/Bookmarks/Bookmark.cs | 35 +-- ESI.NET/Models/Bookmarks/Folder.cs | 8 +- ESI.NET/Models/Calendar/CalendarItem.cs | 17 +- ESI.NET/Models/Calendar/Event.cs | 32 +-- ESI.NET/Models/Calendar/Response.cs | 8 +- ESI.NET/Models/Character/Affiliation.cs | 14 +- ESI.NET/Models/Character/Agent.cs | 17 +- ESI.NET/Models/Character/Blueprint.cs | 26 +- ESI.NET/Models/Character/Character.cs | 8 +- ESI.NET/Models/Character/CharacterInfo.cs | 9 +- ESI.NET/Models/Character/ChatChannel.cs | 44 ++-- ESI.NET/Models/Character/Combat.cs | 110 +++----- .../Models/Character/ContactNotification.cs | 17 +- .../Models/Character/CorporationHistory.cs | 14 +- ESI.NET/Models/Character/Fatigue.cs | 8 +- ESI.NET/Models/Character/Industry.cs | 11 +- ESI.NET/Models/Character/Information.cs | 35 +-- ESI.NET/Models/Character/Inventory.cs | 5 +- ESI.NET/Models/Character/Isk.cs | 8 +- ESI.NET/Models/Character/Market.cs | 23 +- ESI.NET/Models/Character/Medal.cs | 41 ++- ESI.NET/Models/Character/Mining.cs | 56 ++--- ESI.NET/Models/Character/Module.cs | 29 +-- ESI.NET/Models/Character/Notification.cs | 23 +- ESI.NET/Models/Character/Orbital.cs | 2 +- ESI.NET/Models/Character/Pve.cs | 5 +- ESI.NET/Models/Character/Roles.cs | 15 +- ESI.NET/Models/Character/Social.cs | 44 ++-- ESI.NET/Models/Character/Title.cs | 8 +- ESI.NET/Models/Character/Travel.cs | 38 +-- ESI.NET/Models/Clones/Clones.cs | 32 +-- ESI.NET/Models/Contacts/Contact.cs | 19 +- ESI.NET/Models/Contacts/Label.cs | 8 +- ESI.NET/Models/Contracts/Bid.cs | 14 +- ESI.NET/Models/Contracts/Contract.cs | 65 ++--- ESI.NET/Models/Contracts/ContractItem.cs | 35 +-- ESI.NET/Models/Corporation/AllianceHistory.cs | 14 +- ESI.NET/Models/Corporation/Blueprint.cs | 26 +- ESI.NET/Models/Corporation/CharacterRoles.cs | 20 +- .../Corporation/CharacterRolesHistory.cs | 20 +- ESI.NET/Models/Corporation/ContainerLog.cs | 38 +-- ESI.NET/Models/Corporation/Corporation.cs | 44 ++-- ESI.NET/Models/Corporation/Facility.cs | 11 +- ESI.NET/Models/Corporation/IssuedMedal.cs | 20 +- ESI.NET/Models/Corporation/Medal.cs | 17 +- ESI.NET/Models/Corporation/MemberInfo.cs | 23 +- ESI.NET/Models/Corporation/MemberTitles.cs | 9 +- ESI.NET/Models/Corporation/Outpost.cs | 29 +-- ESI.NET/Models/Corporation/Shareholder.cs | 11 +- ESI.NET/Models/Corporation/Starbase.cs | 26 +- ESI.NET/Models/Corporation/StarbaseInfo.cs | 32 +-- ESI.NET/Models/Corporation/Structure.cs | 53 ++-- ESI.NET/Models/Corporation/Title.cs | 23 +- ESI.NET/Models/Corporation/WalletDivision.cs | 14 +- ESI.NET/Models/Dogma/Attribute.cs | 32 +-- ESI.NET/Models/Dogma/DynamicItem.cs | 15 +- ESI.NET/Models/Dogma/Effect.cs | 68 ++--- .../FactionWarfare/FactionWarfareSystem.cs | 17 +- ESI.NET/Models/FactionWarfare/Leaderboards.cs | 35 +-- ESI.NET/Models/FactionWarfare/Stat.cs | 29 +-- ESI.NET/Models/FactionWarfare/War.cs | 6 +- ESI.NET/Models/Fittings/Fitting.cs | 26 +- ESI.NET/Models/Fittings/NewFitting.cs | 5 +- ESI.NET/Models/Fleets/FleetInfo.cs | 14 +- ESI.NET/Models/Fleets/Member.cs | 32 +-- ESI.NET/Models/Fleets/NewSquad.cs | 5 +- ESI.NET/Models/Fleets/NewWing.cs | 5 +- ESI.NET/Models/Fleets/Settings.cs | 14 +- ESI.NET/Models/Fleets/Wing.cs | 17 +- ESI.NET/Models/Images.cs | 16 +- ESI.NET/Models/Incursions/Incursion.cs | 20 +- ESI.NET/Models/Industry/Entry.cs | 14 +- ESI.NET/Models/Industry/Extraction.cs | 14 +- ESI.NET/Models/Industry/Facility.cs | 20 +- ESI.NET/Models/Industry/Job.cs | 62 ++--- ESI.NET/Models/Industry/Observer.cs | 11 +- ESI.NET/Models/Industry/ObserverInfo.cs | 14 +- ESI.NET/Models/Industry/SolarSystem.cs | 14 +- ESI.NET/Models/Insurance/Insurance.cs | 17 +- ESI.NET/Models/Killmails/Information.cs | 92 +++---- ESI.NET/Models/Killmails/Killmail.cs | 8 +- ESI.NET/Models/Location/Activity.cs | 14 +- ESI.NET/Models/Location/Location.cs | 11 +- ESI.NET/Models/Location/Ship.cs | 11 +- ESI.NET/Models/Loyalty/Offer.cs | 29 +-- ESI.NET/Models/Loyalty/Points.cs | 8 +- ESI.NET/Models/Mail/Header.cs | 23 +- ESI.NET/Models/Mail/LabelCounts.cs | 20 +- ESI.NET/Models/Mail/MailingList.cs | 8 +- ESI.NET/Models/Mail/Message.cs | 29 +-- ESI.NET/Models/Market/Group.cs | 17 +- ESI.NET/Models/Market/Order.cs | 36 +-- ESI.NET/Models/Market/Price.cs | 11 +- ESI.NET/Models/Market/Statistic.cs | 20 +- ESI.NET/Models/Opportunities/CompletedTask.cs | 8 +- ESI.NET/Models/Opportunities/Group.cs | 20 +- ESI.NET/Models/Opportunities/Task.cs | 14 +- .../PlanetaryInteraction/ColonyLayout.cs | 110 +++----- .../PlanetaryInteraction/CustomsOffice.cs | 23 +- ESI.NET/Models/PlanetaryInteraction/Planet.cs | 23 +- .../Models/PlanetaryInteraction/Schematic.cs | 8 +- ESI.NET/Models/Position.cs | 11 +- ESI.NET/Models/Search/SearchResults.cs | 35 +-- ESI.NET/Models/Skills/Attributes.cs | 23 +- ESI.NET/Models/Skills/SkillDetails.cs | 23 +- ESI.NET/Models/Skills/SkillQueueItem.cs | 26 +- ESI.NET/Models/Sovereignty/Campaign.cs | 38 +-- ESI.NET/Models/Sovereignty/Structure.cs | 17 +- .../Models/Sovereignty/SystemSovereignty.cs | 14 +- ESI.NET/Models/Standing.cs | 11 +- ESI.NET/Models/Status/Status.cs | 14 +- ESI.NET/Models/Universe/Ancestry.cs | 21 +- ESI.NET/Models/Universe/AsteroidBelt.cs | 11 +- ESI.NET/Models/Universe/Bloodline.cs | 36 +-- ESI.NET/Models/Universe/Category.cs | 14 +- ESI.NET/Models/Universe/Constellation.cs | 17 +- ESI.NET/Models/Universe/Faction.cs | 27 +- ESI.NET/Models/Universe/Graphic.cs | 27 +- ESI.NET/Models/Universe/Group.cs | 17 +- ESI.NET/Models/Universe/IDLookup.cs | 30 +-- ESI.NET/Models/Universe/Jumps.cs | 8 +- ESI.NET/Models/Universe/Kills.cs | 14 +- ESI.NET/Models/Universe/Moon.cs | 14 +- ESI.NET/Models/Universe/Planet.cs | 3 +- ESI.NET/Models/Universe/Race.cs | 14 +- ESI.NET/Models/Universe/Region.cs | 14 +- ESI.NET/Models/Universe/ResolvedInfo.cs | 11 +- ESI.NET/Models/Universe/SolarSystem.cs | 32 +-- ESI.NET/Models/Universe/Star.cs | 26 +- ESI.NET/Models/Universe/Stargate.cs | 26 +- ESI.NET/Models/Universe/Station.cs | 29 +-- ESI.NET/Models/Universe/Structure.cs | 14 +- ESI.NET/Models/Universe/Type.cs | 62 ++--- ESI.NET/Models/Wallet/JournalEntry.cs | 41 ++- ESI.NET/Models/Wallet/Transaction.cs | 32 +-- ESI.NET/Models/Wallet/Wallet.cs | 8 +- ESI.NET/Models/Wars/War.cs | 51 ++-- .../Models/_SSO/AuthorizedCharacterData.cs | 2 +- ESI.NET/Models/_SSO/SSOToken.cs | 14 +- 227 files changed, 3580 insertions(+), 2527 deletions(-) create mode 100644 ESI.NET/Interfaces/Logic/IAllianceLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IAssetsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IBookmarksLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ICalendarLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ICharacterLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IClonesLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IContactsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IContractsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ICorporationLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IDogmaLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IFactionWarfareLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IFittingsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IFleetsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IIncursionsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IIndustryLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IInsuranceLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IKillmailsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ILocationLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ILoyaltyLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IMailLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IMarketLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IOpportunitiesLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IPlanetaryInteractionLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IRoutesLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ISearchLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ISkillsLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ISovereigntyLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/ISsoLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IStatusLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IUniverseLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IUserInterfaceLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IWalletLogic.cs create mode 100644 ESI.NET/Interfaces/Logic/IWarsLogic.cs diff --git a/ESI.NET/Enumerations/Contested.cs b/ESI.NET/Enumerations/Contested.cs index a5fa16e..29271ce 100644 --- a/ESI.NET/Enumerations/Contested.cs +++ b/ESI.NET/Enumerations/Contested.cs @@ -4,9 +4,9 @@ namespace ESI.NET.Enumerations { public enum Contested { - [EnumMember(Value = "captured")] /**/ Captured, - [EnumMember(Value = "contested")] /**/ Contested, + [EnumMember(Value = "captured")] /**/ Captured, + [EnumMember(Value = "contested")] /**/ Contested, [EnumMember(Value = "uncontested")] /**/ Uncontested, [EnumMember(Value = "vulnerable ")] /**/ Vulnerable } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/ContractType.cs b/ESI.NET/Enumerations/ContractType.cs index 4da4d11..2a5520f 100644 --- a/ESI.NET/Enumerations/ContractType.cs +++ b/ESI.NET/Enumerations/ContractType.cs @@ -6,10 +6,10 @@ namespace ESI.NET.Enumerations [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ContractType { - [EnumMember(Value = "unknown")] /**/ Unknown, - [EnumMember(Value = "item_exchange")] /**/ ItemExchange, + [EnumMember(Value = "unknown")] /**/ Unknown, + [EnumMember(Value = "item_exchange")] /**/ ItemExchange, [EnumMember(Value = "auction")] /**/ Auction, [EnumMember(Value = "courier")] /**/ Courier, [EnumMember(Value = "loan ")] /**/ Loan } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/DataSource.cs b/ESI.NET/Enumerations/DataSource.cs index d8aa361..662ece8 100644 --- a/ESI.NET/Enumerations/DataSource.cs +++ b/ESI.NET/Enumerations/DataSource.cs @@ -6,6 +6,6 @@ public enum DataSource { [EnumMember(Value = "singularity")] /**/ Singularity, [EnumMember(Value = "tranquility")] /**/ Tranquility, - [EnumMember(Value = "serenity")] /**/ Serenity + [EnumMember(Value = "serenity")] /**/ Serenity } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/EventResponse.cs b/ESI.NET/Enumerations/EventResponse.cs index eaf76d1..936acf8 100644 --- a/ESI.NET/Enumerations/EventResponse.cs +++ b/ESI.NET/Enumerations/EventResponse.cs @@ -6,8 +6,8 @@ namespace ESI.NET.Enumerations [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum EventResponse { - [EnumMember(Value="accepted")] /**/ Accepted, - [EnumMember(Value="declined")] /**/ Declined, - [EnumMember(Value="tentative")] /**/ Tentative + [EnumMember(Value = "accepted")] /**/ Accepted, + [EnumMember(Value = "declined")] /**/ Declined, + [EnumMember(Value = "tentative")] /**/ Tentative } } \ No newline at end of file diff --git a/ESI.NET/Enumerations/FleetRole.cs b/ESI.NET/Enumerations/FleetRole.cs index 40fa374..67d72f9 100644 --- a/ESI.NET/Enumerations/FleetRole.cs +++ b/ESI.NET/Enumerations/FleetRole.cs @@ -6,9 +6,9 @@ namespace ESI.NET.Enumerations [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum FleetRole { - [EnumMember(Value="fleet_commander")] /**/ FleetCommander, - [EnumMember(Value="wing_commander")] /**/ WingCommander, - [EnumMember(Value="squad_commander")] /**/ SquadCommander, - [EnumMember(Value="squad_member")] /**/ SquadMember + [EnumMember(Value = "fleet_commander")] /**/ FleetCommander, + [EnumMember(Value = "wing_commander")] /**/ WingCommander, + [EnumMember(Value = "squad_commander")] /**/ SquadCommander, + [EnumMember(Value = "squad_member")] /**/ SquadMember } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/GrantType.cs b/ESI.NET/Enumerations/GrantType.cs index e0931ca..8a95562 100644 --- a/ESI.NET/Enumerations/GrantType.cs +++ b/ESI.NET/Enumerations/GrantType.cs @@ -5,7 +5,7 @@ namespace ESI.NET.Enumerations { public enum GrantType { - [EnumMember(Value="authorization_code")] /**/ AuthorizationCode, - [EnumMember(Value="refresh_token")] /**/ RefreshToken + [EnumMember(Value = "authorization_code")] /**/ AuthorizationCode, + [EnumMember(Value = "refresh_token")] /**/ RefreshToken } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/MarketOrderType.cs b/ESI.NET/Enumerations/MarketOrderType.cs index 67d6eea..1197925 100644 --- a/ESI.NET/Enumerations/MarketOrderType.cs +++ b/ESI.NET/Enumerations/MarketOrderType.cs @@ -6,8 +6,8 @@ namespace ESI.NET.Enumerations [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum MarketOrderType { - [EnumMember(Value="all")] /**/ All, - [EnumMember(Value="buy")] /**/ Buy, - [EnumMember(Value="sell")] /**/ Sell + [EnumMember(Value = "all")] /**/ All, + [EnumMember(Value = "buy")] /**/ Buy, + [EnumMember(Value = "sell")] /**/ Sell } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/ResolvedInfoCategory.cs b/ESI.NET/Enumerations/ResolvedInfoCategory.cs index 00d1ab4..371aa51 100644 --- a/ESI.NET/Enumerations/ResolvedInfoCategory.cs +++ b/ESI.NET/Enumerations/ResolvedInfoCategory.cs @@ -16,6 +16,5 @@ public enum ResolvedInfoCategory [EnumMember(Value = "station")] Station, [EnumMember(Value = "faction")] Faction, [EnumMember(Value = "structure")] Structure - } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/RoutesFlag.cs b/ESI.NET/Enumerations/RoutesFlag.cs index db83f81..8961055 100644 --- a/ESI.NET/Enumerations/RoutesFlag.cs +++ b/ESI.NET/Enumerations/RoutesFlag.cs @@ -6,8 +6,8 @@ namespace ESI.NET.Enumerations [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum RoutesFlag { - [EnumMember(Value="shortest")] /**/ Shortest, - [EnumMember(Value="secure")] /**/ Secure, - [EnumMember(Value="insecure")] /**/ Insecure + [EnumMember(Value = "shortest")] /**/ Shortest, + [EnumMember(Value = "secure")] /**/ Secure, + [EnumMember(Value = "insecure")] /**/ Insecure } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/SearchCategory.cs b/ESI.NET/Enumerations/SearchCategory.cs index fd00d2b..e9ed27f 100644 --- a/ESI.NET/Enumerations/SearchCategory.cs +++ b/ESI.NET/Enumerations/SearchCategory.cs @@ -6,16 +6,16 @@ namespace ESI.NET.Enumerations [Flags] public enum SearchCategory { - [EnumMember(Value="agent")] /**/ Agent = 1, - [EnumMember(Value="alliance")] /**/ Alliance = 2, - [EnumMember(Value="character")] /**/ Character = 4, - [EnumMember(Value="constellation")] /**/ Constellation = 8, - [EnumMember(Value="corporation")] /**/ Corporation = 16, - [EnumMember(Value="faction")] /**/ Faction = 32, - [EnumMember(Value="inventory_type")] /**/ InventoryType = 64, - [EnumMember(Value="region")] /**/ Region = 128, - [EnumMember(Value="solar_system")] /**/ SolarSystem = 256, - [EnumMember(Value="station")] /**/ Station = 512, - [EnumMember(Value="structure")] /**/ Structure = 1024 + [EnumMember(Value = "agent")] /**/ Agent = 1, + [EnumMember(Value = "alliance")] /**/ Alliance = 2, + [EnumMember(Value = "character")] /**/ Character = 4, + [EnumMember(Value = "constellation")] /**/ Constellation = 8, + [EnumMember(Value = "corporation")] /**/ Corporation = 16, + [EnumMember(Value = "faction")] /**/ Faction = 32, + [EnumMember(Value = "inventory_type")] /**/ InventoryType = 64, + [EnumMember(Value = "region")] /**/ Region = 128, + [EnumMember(Value = "solar_system")] /**/ SolarSystem = 256, + [EnumMember(Value = "station")] /**/ Station = 512, + [EnumMember(Value = "structure")] /**/ Structure = 1024 } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/SearchType.cs b/ESI.NET/Enumerations/SearchType.cs index 125cd3a..f05b0f1 100644 --- a/ESI.NET/Enumerations/SearchType.cs +++ b/ESI.NET/Enumerations/SearchType.cs @@ -5,4 +5,4 @@ public enum SearchType Public, Character } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/StructureServiceState.cs b/ESI.NET/Enumerations/StructureServiceState.cs index 6b5a39c..456d89a 100644 --- a/ESI.NET/Enumerations/StructureServiceState.cs +++ b/ESI.NET/Enumerations/StructureServiceState.cs @@ -10,4 +10,4 @@ public enum StructureServiceState [EnumMember(Value = "offline")] Offline, [EnumMember(Value = "cleamup")] Cleanup } -} +} \ No newline at end of file diff --git a/ESI.NET/Enumerations/StructureState.cs b/ESI.NET/Enumerations/StructureState.cs index 7c105a4..0e2b02f 100644 --- a/ESI.NET/Enumerations/StructureState.cs +++ b/ESI.NET/Enumerations/StructureState.cs @@ -6,18 +6,35 @@ namespace ESI.NET.Enumerations [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum StructureState { - [EnumMember(Value = "anchor_vulnerable")] AnchorVulnerable, + [EnumMember(Value = "anchor_vulnerable")] + AnchorVulnerable, [EnumMember(Value = "anchoring")] Anchoring, - [EnumMember(Value = "armor_reinforce")] ArmorReinforce, - [EnumMember(Value = "armor_vulnerable")] ArmorVulnerable, - [EnumMember(Value = "deploy_vulnerable")] DeployVulnerable, - [EnumMember(Value = "fitting_invulnerable")] FittingInvulnerable, + + [EnumMember(Value = "armor_reinforce")] + ArmorReinforce, + + [EnumMember(Value = "armor_vulnerable")] + ArmorVulnerable, + + [EnumMember(Value = "deploy_vulnerable")] + DeployVulnerable, + + [EnumMember(Value = "fitting_invulnerable")] + FittingInvulnerable, [EnumMember(Value = "hull_reinforce")] HullReinforce, - [EnumMember(Value = "hull_vulnerable")] HullVulnerable, - [EnumMember(Value = "online_deprecated")] OnlineDeprecated, - [EnumMember(Value = "onlining_vulnerable")] OnliningVulnerable, - [EnumMember(Value = "shield_vulnerable")] ShieldVulnerable, + + [EnumMember(Value = "hull_vulnerable")] + HullVulnerable, + + [EnumMember(Value = "online_deprecated")] + OnlineDeprecated, + + [EnumMember(Value = "onlining_vulnerable")] + OnliningVulnerable, + + [EnumMember(Value = "shield_vulnerable")] + ShieldVulnerable, [EnumMember(Value = "unanchored")] Unanchored, [EnumMember(Value = "unknown")] Unknown } -} +} \ No newline at end of file diff --git a/ESI.NET/EsiClient.cs b/ESI.NET/EsiClient.cs index b84e5e1..76b5f1a 100644 --- a/ESI.NET/EsiClient.cs +++ b/ESI.NET/EsiClient.cs @@ -5,6 +5,7 @@ using System.Net; using System.Net.Http; using System.Net.Http.Headers; +using ESI.NET.Interfaces.Logic; namespace ESI.NET { @@ -23,11 +24,9 @@ public EsiClient(IOptions _config, HttpClient _client = null) config = _config.Value; client = _client ?? new HttpClient(new HttpClientHandler { - - // Switch to All which adds brotli encoding for .net core due to https://github.com/ccpgames/sso-issues/issues/81 #if NET - AutomaticDecompression = DecompressionMethods.All + AutomaticDecompression = DecompressionMethods.All #else AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate #endif @@ -35,7 +34,8 @@ public EsiClient(IOptions _config, HttpClient _client = null) // Enforce user agent value if (string.IsNullOrEmpty(config.UserAgent)) - throw new ArgumentException("For your protection, please provide an X-User-Agent value. This can be your character name and/or project name. CCP will be more likely to contact you rather than just cut off access to ESI if you provide something that can identify you within the New Eden galaxy."); + throw new ArgumentException( + "For your protection, please provide an X-User-Agent value. This can be your character name and/or project name. CCP will be more likely to contact you rather than just cut off access to ESI if you provide something that can identify you within the New Eden galaxy."); client.DefaultRequestHeaders.Add("X-User-Agent", config.UserAgent); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); @@ -78,39 +78,39 @@ public EsiClient(IOptions _config, HttpClient _client = null) Wars = new WarsLogic(client, config); } - public SsoLogic SSO { get; set; } - public AllianceLogic Alliance { get; set; } - public AssetsLogic Assets { get; set; } - public BookmarksLogic Bookmarks { get; set; } - public CalendarLogic Calendar { get; set; } - public CharacterLogic Character { get; set; } - public ClonesLogic Clones { get; set; } - public ContactsLogic Contacts { get; set; } - public ContractsLogic Contracts { get; set; } - public CorporationLogic Corporation { get; set; } - public DogmaLogic Dogma { get; set; } - public FactionWarfareLogic FactionWarfare { get; set; } - public FleetsLogic Fleets { get; set; } - public FittingsLogic Fittings { get; set; } - public IncursionsLogic Incursions { get; set; } - public IndustryLogic Industry { get; set; } - public InsuranceLogic Insurance { get; set; } - public KillmailsLogic Killmails { get; set; } - public LocationLogic Location { get; set; } - public LoyaltyLogic Loyalty { get; set; } - public MailLogic Mail { get; set; } - public MarketLogic Market { get; set; } - public OpportunitiesLogic Opportunities { get; set; } - public PlanetaryInteractionLogic PlanetaryInteraction { get; set; } - public RoutesLogic Routes { get; set; } - public SearchLogic Search { get; set; } - public SkillsLogic Skills { get; set; } - public StatusLogic Status { get; set; } - public SovereigntyLogic Sovereignty { get; set; } - public UniverseLogic Universe { get; set; } - public UserInterfaceLogic UserInterface { get; set; } - public WalletLogic Wallet { get; set; } - public WarsLogic Wars { get; set; } + public ISsoLogic SSO { get; set; } + public IAllianceLogic Alliance { get; set; } + public IAssetsLogic Assets { get; set; } + public IBookmarksLogic Bookmarks { get; set; } + public ICalendarLogic Calendar { get; set; } + public ICharacterLogic Character { get; set; } + public IClonesLogic Clones { get; set; } + public IContactsLogic Contacts { get; set; } + public IContractsLogic Contracts { get; set; } + public ICorporationLogic Corporation { get; set; } + public IDogmaLogic Dogma { get; set; } + public IFactionWarfareLogic FactionWarfare { get; set; } + public IFleetsLogic Fleets { get; set; } + public IFittingsLogic Fittings { get; set; } + public IIncursionsLogic Incursions { get; set; } + public IIndustryLogic Industry { get; set; } + public IInsuranceLogic Insurance { get; set; } + public IKillmailsLogic Killmails { get; set; } + public ILocationLogic Location { get; set; } + public ILoyaltyLogic Loyalty { get; set; } + public IMailLogic Mail { get; set; } + public IMarketLogic Market { get; set; } + public IOpportunitiesLogic Opportunities { get; set; } + public IPlanetaryInteractionLogic PlanetaryInteraction { get; set; } + public IRoutesLogic Routes { get; set; } + public ISearchLogic Search { get; set; } + public ISkillsLogic Skills { get; set; } + public IStatusLogic Status { get; set; } + public ISovereigntyLogic Sovereignty { get; set; } + public IUniverseLogic Universe { get; set; } + public IUserInterfaceLogic UserInterface { get; set; } + public IWalletLogic Wallet { get; set; } + public IWarsLogic Wars { get; set; } public void SetCharacterData(AuthorizedCharacterData data) @@ -148,41 +148,41 @@ public void SetIfNoneMatchHeader(string eTag) public interface IEsiClient { - SsoLogic SSO { get; set; } - AllianceLogic Alliance { get; set; } - AssetsLogic Assets { get; set; } - BookmarksLogic Bookmarks { get; set; } - CalendarLogic Calendar { get; set; } - CharacterLogic Character { get; set; } - ClonesLogic Clones { get; set; } - ContactsLogic Contacts { get; set; } - ContractsLogic Contracts { get; set; } - CorporationLogic Corporation { get; set; } - DogmaLogic Dogma { get; set; } - FactionWarfareLogic FactionWarfare { get; set; } - FittingsLogic Fittings { get; set; } - FleetsLogic Fleets { get; set; } - IncursionsLogic Incursions { get; set; } - IndustryLogic Industry { get; set; } - InsuranceLogic Insurance { get; set; } - KillmailsLogic Killmails { get; set; } - LocationLogic Location { get; set; } - LoyaltyLogic Loyalty { get; set; } - MailLogic Mail { get; set; } - MarketLogic Market { get; set; } - OpportunitiesLogic Opportunities { get; set; } - PlanetaryInteractionLogic PlanetaryInteraction { get; set; } - RoutesLogic Routes { get; set; } - SearchLogic Search { get; set; } - SkillsLogic Skills { get; set; } - SovereigntyLogic Sovereignty { get; set; } - StatusLogic Status { get; set; } - UniverseLogic Universe { get; set; } - UserInterfaceLogic UserInterface { get; set; } - WalletLogic Wallet { get; set; } - WarsLogic Wars { get; set; } + ISsoLogic SSO { get; set; } + IAllianceLogic Alliance { get; set; } + IAssetsLogic Assets { get; set; } + IBookmarksLogic Bookmarks { get; set; } + ICalendarLogic Calendar { get; set; } + ICharacterLogic Character { get; set; } + IClonesLogic Clones { get; set; } + IContactsLogic Contacts { get; set; } + IContractsLogic Contracts { get; set; } + ICorporationLogic Corporation { get; set; } + IDogmaLogic Dogma { get; set; } + IFactionWarfareLogic FactionWarfare { get; set; } + IFittingsLogic Fittings { get; set; } + IFleetsLogic Fleets { get; set; } + IIncursionsLogic Incursions { get; set; } + IIndustryLogic Industry { get; set; } + IInsuranceLogic Insurance { get; set; } + IKillmailsLogic Killmails { get; set; } + ILocationLogic Location { get; set; } + ILoyaltyLogic Loyalty { get; set; } + IMailLogic Mail { get; set; } + IMarketLogic Market { get; set; } + IOpportunitiesLogic Opportunities { get; set; } + IPlanetaryInteractionLogic PlanetaryInteraction { get; set; } + IRoutesLogic Routes { get; set; } + ISearchLogic Search { get; set; } + ISkillsLogic Skills { get; set; } + ISovereigntyLogic Sovereignty { get; set; } + IStatusLogic Status { get; set; } + IUniverseLogic Universe { get; set; } + IUserInterfaceLogic UserInterface { get; set; } + IWalletLogic Wallet { get; set; } + IWarsLogic Wars { get; set; } void SetCharacterData(AuthorizedCharacterData data); void SetIfNoneMatchHeader(string eTag); } -} +} \ No newline at end of file diff --git a/ESI.NET/EsiConfig.cs b/ESI.NET/EsiConfig.cs index 31d612c..73c64fc 100644 --- a/ESI.NET/EsiConfig.cs +++ b/ESI.NET/EsiConfig.cs @@ -11,4 +11,4 @@ public class EsiConfig public string CallbackUrl { get; set; } public string UserAgent { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/EsiRequest.cs b/ESI.NET/EsiRequest.cs index f68b700..bb3a032 100644 --- a/ESI.NET/EsiRequest.cs +++ b/ESI.NET/EsiRequest.cs @@ -14,10 +14,10 @@ internal static class EsiRequest internal static string ETag; public static async Task> Execute( - HttpClient client, + HttpClient client, EsiConfig config, - RequestSecurity security, - HttpMethod httpMethod, + RequestSecurity security, + HttpMethod httpMethod, string endpoint, string eTag = null, CancellationToken cancellationToken = default, diff --git a/ESI.NET/EsiResponse.cs b/ESI.NET/EsiResponse.cs index 2f163cd..da4b058 100644 --- a/ESI.NET/EsiResponse.cs +++ b/ESI.NET/EsiResponse.cs @@ -45,7 +45,8 @@ public EsiResponse(HttpResponseMessage response, string path) if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.Created) { - if ((result.StartsWith("{") && result.EndsWith("}")) || result.StartsWith("[") && result.EndsWith("]")) + if ((result.StartsWith("{") && result.EndsWith("}")) || + result.StartsWith("[") && result.EndsWith("]")) Data = JsonConvert.DeserializeObject(result); else Message = result; @@ -53,11 +54,10 @@ public EsiResponse(HttpResponseMessage response, string path) else if (response.StatusCode == HttpStatusCode.NotModified) Message = "Not Modified"; else - Message = JsonConvert.DeserializeAnonymousType(result, new { error = string.Empty }).error; + Message = JsonConvert.DeserializeAnonymousType(result, new {error = string.Empty}).error; } else if (response.StatusCode == HttpStatusCode.NoContent) Message = _noContentMessage[path]; - } catch (Exception ex) { @@ -124,4 +124,4 @@ public EsiResponse(HttpResponseMessage response, string path) {"POST|/ui/openwindow/newmail/", "Open window request received"} }.ToImmutableDictionary(); } -} +} \ No newline at end of file diff --git a/ESI.NET/Extensions.cs b/ESI.NET/Extensions.cs index fedd252..fe0deb4 100644 --- a/ESI.NET/Extensions.cs +++ b/ESI.NET/Extensions.cs @@ -26,7 +26,8 @@ public static string ToEsiValue(this Enum e) var values = enums.Replace(" ", "").Split(','); var newValues = new List(); foreach (var item in values) - newValues.Add(Enum.Parse(e.GetType(), item).GetType().GetTypeInfo().DeclaredMembers.SingleOrDefault(x => x.Name == item.ToString()) + newValues.Add(Enum.Parse(e.GetType(), item).GetType().GetTypeInfo().DeclaredMembers + .SingleOrDefault(x => x.Name == item.ToString()) ?.GetCustomAttribute(true)?.Value); return string.Join(",", newValues); @@ -36,4 +37,4 @@ public static string ToEsiValue(this Enum e) ?.GetCustomAttribute(false)?.Value; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IAllianceLogic.cs b/ESI.NET/Interfaces/Logic/IAllianceLogic.cs new file mode 100644 index 0000000..7b8b0c8 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IAllianceLogic.cs @@ -0,0 +1,40 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models; +using ESI.NET.Models.Alliance; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IAllianceLogic + { + /// + /// /alliances/ + /// + /// + Task> All(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /alliances/{alliance_id}/ + /// + /// + /// + Task> Information(int alliance_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /alliances/{alliance_id}/corporations/ + /// + /// + /// + Task> Corporations(int alliance_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /alliances/{alliance_id}/icons/ + /// + /// + /// + Task> Icons(int alliance_id, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IAssetsLogic.cs b/ESI.NET/Interfaces/Logic/IAssetsLogic.cs new file mode 100644 index 0000000..d598c3f --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IAssetsLogic.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Assets; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IAssetsLogic + { + /// + /// /characters/{character_id}/assets/ + /// + /// + /// + Task>> ForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/assets/locations/ + /// + /// + /// + Task>> LocationsForCharacter(List item_ids, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/assets/names/ + /// + /// + /// + Task>> NamesForCharacter(List item_ids, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/assets/ + /// + /// + /// + Task>> ForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/assets/locations/ + /// + /// + /// + Task>> LocationsForCorporation(List item_ids, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/assets/names/ + /// + /// + /// + Task>> NamesForCorporation(List item_ids, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IBookmarksLogic.cs b/ESI.NET/Interfaces/Logic/IBookmarksLogic.cs new file mode 100644 index 0000000..5e9eae0 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IBookmarksLogic.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Bookmarks; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IBookmarksLogic + { + /// + /// /characters/{character_id}/bookmarks/ + /// + /// + Task>> ForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/bookmarks/folders/ + /// + /// + Task>> FoldersForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/bookmarks/ + /// + /// + Task>> ForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/bookmarks/folders/ + /// + /// + Task>> FoldersForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ICalendarLogic.cs b/ESI.NET/Interfaces/Logic/ICalendarLogic.cs new file mode 100644 index 0000000..5594490 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ICalendarLogic.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Enumerations; +using ESI.NET.Models.Calendar; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ICalendarLogic + { + /// + /// /characters/{character_id}/calendar/ + /// + /// + Task>> Events(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/calendar/{event_id}/ + /// + /// + /// + Task> Event(int event_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/calendar/{event_id}/ + /// + /// + /// + /// + Task> Respond(int event_id, EventResponse eventResponse, + CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + Task>> Responses(int event_id, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ICharacterLogic.cs b/ESI.NET/Interfaces/Logic/ICharacterLogic.cs new file mode 100644 index 0000000..925bb7c --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ICharacterLogic.cs @@ -0,0 +1,124 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models; +using ESI.NET.Models.Character; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ICharacterLogic + { + /// + /// /characters/affiliation/ + /// + /// dynamic = long + /// + Task>> Affiliation(int[] character_ids, + CancellationToken cancellationToken = default); + + /// + /// /characters/names/ + /// + /// + /// + Task>> Names(int[] character_ids, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/ + /// + /// + /// + Task> Information(int character_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/agents_research/ + /// + /// + Task>> AgentsResearch(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/blueprints/ + /// + /// Which page of results to return + /// + Task>> Blueprints(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/chat_channels/ + /// + /// + Task>> ChatChannels(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/corporationhistory/ + /// + /// + /// + Task>> CorporationHistory(int character_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/cspa/ + /// + /// The target characters to calculate the charge for + /// + Task> CSPA(object character_ids, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/fatigue/ + /// + /// + Task> Fatigue(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/medals/ + /// + /// + Task>> Medals(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/notifications/ + /// + /// + Task>> Notifications(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/notifications/contacts/ + /// + /// + Task>> ContactNotifications(); + + /// + /// /characters/{character_id}/portrait/ + /// + /// + /// + Task> Portrait(int character_id); + + /// + /// /characters/{character_id}/roles/ + /// + /// + Task> Roles(); + + /// + /// /characters/{character_id}/standings/ + /// + /// + Task>> Standings(); + + /// + /// /characters/{character_id}/titles/ + /// + /// + Task>> Titles(); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IClonesLogic.cs b/ESI.NET/Interfaces/Logic/IClonesLogic.cs new file mode 100644 index 0000000..128007a --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IClonesLogic.cs @@ -0,0 +1,23 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Clones; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IClonesLogic + { + /// + /// /characters/{character_id}/clones/ + /// + /// + Task> List(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/implants/ + /// + /// + Task> Implants(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IContactsLogic.cs b/ESI.NET/Interfaces/Logic/IContactsLogic.cs new file mode 100644 index 0000000..0066f9b --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IContactsLogic.cs @@ -0,0 +1,83 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Contacts; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IContactsLogic + { + /// + /// /characters/{character_id}/contacts/ + /// + /// + /// + Task>> ListForCharacter(int page = 1, + string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/contacts/ + /// + /// + /// + Task>> ListForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /alliances/{alliance_id}/contacts/ + /// + /// + /// + Task>> ListForAlliance(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contacts/ + /// + /// + /// + /// + /// + /// + Task> Add(int[] contact_ids, decimal standing, int[] label_ids = null, + bool? watched = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contacts/ + /// + /// + /// + /// + /// + /// + Task> Update(int[] contact_ids, decimal standing, int[] label_ids = null, + bool? watched = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contacts/ + /// + /// + /// + Task> Delete(int[] contact_ids, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contacts/labels/ + /// + /// + Task>> LabelsForCharacter(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/contacts/labels/ + /// + /// + Task>> LabelsForCorporation(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /alliances/{alliance_id}/contacts/labels/ + /// + /// + Task>> LabelsForAlliance(); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IContractsLogic.cs b/ESI.NET/Interfaces/Logic/IContractsLogic.cs new file mode 100644 index 0000000..1e35996 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IContractsLogic.cs @@ -0,0 +1,82 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Contracts; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IContractsLogic + { + /// + /// /contracts/public/{region_id}/ + /// + /// + /// + Task>> Contracts(int region_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /contracts/public/items/{contract_id}/ + /// + /// + /// + Task>> ContractItems(int contract_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// "/contracts/public/bids/{contract_id}/ + /// + /// + /// + Task>> ContractBids(int contract_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contracts/ + /// + /// + Task>> CharacterContracts(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contracts/{contract_id}/items/ + /// + /// + /// + Task>> CharacterContractItems(int contract_id, int page = 1, + string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/contracts/{contract_id}/bids/ + /// + /// + /// + Task>> CharacterContractBids(int contract_id, int page = 1, + string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/contracts/ + /// + /// + Task>> CorporationContracts(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/contracts/{contract_id}/items/ + /// + /// + /// + Task>> CorporationContractItems(int contract_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/contracts/{contract_id}/bids/ + /// + /// + /// + Task>> CorporationContractBids(int contract_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ICorporationLogic.cs b/ESI.NET/Interfaces/Logic/ICorporationLogic.cs new file mode 100644 index 0000000..dae1aea --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ICorporationLogic.cs @@ -0,0 +1,177 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models; +using ESI.NET.Models.Corporation; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ICorporationLogic + { + /// + /// /corporations/npccorps/ + /// + /// + Task> NpcCorps(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/ + /// + /// + /// + Task> Information(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/alliancehistory/ + /// + /// + /// + Task>> AllianceHistory(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/blueprints/ + /// + /// + /// + Task>> Blueprints(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/containers/logs/ + /// + /// + /// + Task>> ContainerLogs(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/divisions/ + /// + /// + Task> Divisions(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/facilities/ + /// + /// + Task>> Facilities(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/icons/ + /// + /// + /// + Task> Icons(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/medals/ + /// + /// + /// + Task>> Medals(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/medals/issued/ + /// + /// + /// + Task>> MedalsIssued(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/members/ + /// + /// + Task> Members(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/members/limit/ + /// + /// + Task> MemberLimit(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/members/titles/ + /// + /// + Task>> MemberTitles(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/membertracking/ + /// + /// + Task>> MemberTracking(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/roles/ + /// + /// + Task>> Roles(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/roles/history/ + /// + /// + Task>> RolesHistory(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/shareholders/ + /// + /// + /// + Task>> Shareholders(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/standings/ + /// + /// + /// + Task> Standings(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/starbases/ + /// + /// + /// + Task>> Starbases(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/starbases/{starbase_id}/ + /// + /// + /// + /// + Task> Starbase(long starbase_id, int system_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/structures/ + /// + /// + Task>> Structures(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/titles/ + /// + /// + Task>> Titles(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IDogmaLogic.cs b/ESI.NET/Interfaces/Logic/IDogmaLogic.cs new file mode 100644 index 0000000..21fe3c3 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IDogmaLogic.cs @@ -0,0 +1,48 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Dogma; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IDogmaLogic + { + /// + /// /dogma/attributes/ + /// + /// + Task> Attributes(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /dogma/attributes/{attribute_id}/ + /// + /// + /// + Task> Attribute(int attribute_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /dogma/effects/ + /// + /// + Task> Effects(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /dogma/effects/{effect_id}/ + /// + /// + /// + Task> Effect(int effect_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /dogma/dynamic/items/{type_id}/{item_id}/ + /// + /// + /// + /// + Task> DynamicItem(int type_id, long item_id, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IFactionWarfareLogic.cs b/ESI.NET/Interfaces/Logic/IFactionWarfareLogic.cs new file mode 100644 index 0000000..30c83a4 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IFactionWarfareLogic.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.FactionWarfare; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IFactionWarfareLogic + { + /// + /// /fw/wars/ + /// + /// + Task>> List(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fw/stats/ + /// + /// + Task>> Stats(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fw/systems/ + /// + /// + Task>> Systems(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// fw/leaderboards/ + /// + /// + Task>> Leaderboads(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fw/leaderboards/corporations/ + /// + /// + Task>> LeaderboardsForCorporations(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fw/leaderboards/characters/ + /// + /// + Task>> LeaderboardsForCharacters(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/fw/stats/ + /// + /// + Task> StatsForCorporation(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/fw/stats/ + /// + /// + Task> StatsForCharacter(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IFittingsLogic.cs b/ESI.NET/Interfaces/Logic/IFittingsLogic.cs new file mode 100644 index 0000000..f3002a3 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IFittingsLogic.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Fittings; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IFittingsLogic + { + /// + /// /characters/{character_id}/fittings/ + /// + /// + Task>> List(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/fittings/ + /// + /// + /// + Task> Add(object fitting, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/fittings/{fitting_id}/ + /// + /// + /// + Task> Delete(int fitting_id, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IFleetsLogic.cs b/ESI.NET/Interfaces/Logic/IFleetsLogic.cs new file mode 100644 index 0000000..28a691c --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IFleetsLogic.cs @@ -0,0 +1,138 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Enumerations; +using ESI.NET.Models.Fleets; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IFleetsLogic + { + /// + /// /fleets/{fleet_id}/ + /// + /// + /// + Task> Settings(long fleet_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/ + /// + /// + /// + /// + /// + Task> UpdateSettings(long fleet_id, string motd = null, + bool? is_free_move = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/fleet/ + /// + /// + Task> FleetInfo(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/members/ + /// + /// + /// + Task>> Members(long fleet_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/members/ + /// + /// + /// + /// + /// + /// + /// + Task> InviteCharacter(long fleet_id, int character_id, FleetRole role, + long wing_id = 0, long squad_id = 0, CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/members/{member_id}/ + /// + /// + /// + /// + /// + /// + /// + Task> MoveCharacter(long fleet_id, int member_id, FleetRole role, + long wing_id = 0, long squad_id = 0, CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/members/{member_id}/ + /// + /// + /// + /// + Task> KickCharacter(long fleet_id, int member_id, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/wings/ + /// + /// + /// + Task>> Wings(long fleet_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/wings/ + /// + /// + /// + Task> CreateWing(long fleet_id, CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/wings/{wing_id}/ + /// + /// + /// + /// + /// + Task> RenameWing(long fleet_id, long wing_id, string name, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/wings/{wing_id}/ + /// + /// + /// + /// + Task> DeleteWing(long fleet_id, long wing_id, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/wings/{wing_id}/squads/ + /// + /// + /// + /// + Task> CreateSquad(long fleet_id, long wing_id, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/squads/{squad_id}/ + /// + /// + /// + /// + /// + Task> RenameSquad(long fleet_id, long squad_id, string name, + CancellationToken cancellationToken = default); + + /// + /// /fleets/{fleet_id}/squads/{squad_id}/ + /// + /// + /// + /// + Task> DeleteSquad(long fleet_id, long squad_id, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IIncursionsLogic.cs b/ESI.NET/Interfaces/Logic/IIncursionsLogic.cs new file mode 100644 index 0000000..a2851e6 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IIncursionsLogic.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Incursions; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IIncursionsLogic + { + /// + /// /incursions/ + /// + /// + Task>> All(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IIndustryLogic.cs b/ESI.NET/Interfaces/Logic/IIndustryLogic.cs new file mode 100644 index 0000000..1bd120c --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IIndustryLogic.cs @@ -0,0 +1,75 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Industry; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IIndustryLogic + { + /// + /// /industry/facilities/ + /// + /// + Task>> Facilities(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /industry/systems/ + /// + /// + Task>> SolarSystemCostIndices(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/industry/jobs/ + /// + /// + /// + Task>> JobsForCharacter(bool include_completed = false, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mining/ + /// + /// + /// + Task>> MiningLedger(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporation/{corporation_id}/mining/observers/ + /// + /// + /// + Task>> Observers(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporation/{corporation_id}/mining/observers/{observer_id}/ + /// + /// + /// + /// + Task>> ObservedMining(long observer_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/industry/jobs/ + /// + /// + /// + /// + Task>> JobsForCorporation(bool include_completed = false, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporation/{corporation_id}/mining/extractions/ + /// + /// + Task>> Extractions(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IInsuranceLogic.cs b/ESI.NET/Interfaces/Logic/IInsuranceLogic.cs new file mode 100644 index 0000000..2610406 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IInsuranceLogic.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Insurance; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IInsuranceLogic + { + /// + /// /insurance/prices/ + /// + /// + Task>> Levels(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IKillmailsLogic.cs b/ESI.NET/Interfaces/Logic/IKillmailsLogic.cs new file mode 100644 index 0000000..9a32eed --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IKillmailsLogic.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Killmails; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IKillmailsLogic + { + /// + /// /characters/{character_id}/killmails/recent/ + /// + /// + /// + Task>> ForCharacter(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/killmails/recent/ + /// + /// + /// + Task>> ForCorporation(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /killmails/{killmail_id}/{killmail_hash}/ + /// + /// The killmail hash for verification + /// The killmail ID to be queried + /// + Task> Information(string killmail_hash, int killmail_id, + string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ILocationLogic.cs b/ESI.NET/Interfaces/Logic/ILocationLogic.cs new file mode 100644 index 0000000..77bf360 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ILocationLogic.cs @@ -0,0 +1,27 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Location; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ILocationLogic + { + /// + /// /characters/{character_id}/location/ + /// + /// + Task> Location(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/ship/ + /// + /// + Task> Ship(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/online/ + /// + /// + Task> Online(string eTag = null, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ILoyaltyLogic.cs b/ESI.NET/Interfaces/Logic/ILoyaltyLogic.cs new file mode 100644 index 0000000..c1aa7d8 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ILoyaltyLogic.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Loyalty; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ILoyaltyLogic + { + /// + /// /loyalty/stores/{corporation_id}/offers/ + /// + /// + Task>> Offers(int corporation_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/loyalty/points/ + /// + /// + Task>> Points(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IMailLogic.cs b/ESI.NET/Interfaces/Logic/IMailLogic.cs new file mode 100644 index 0000000..9bfa354 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IMailLogic.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Mail; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IMailLogic + { + /// + /// /characters/{character_id}/mail/ + /// + /// + Task>> Headers(long[] labels = null, int last_mail_id = 0, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/ + /// + /// + /// + /// + /// + /// + Task> New(object[] recipients, string subject, string body, int approved_cost = 0, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/labels/ + /// + /// + Task> Labels(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/labels/ + /// + /// + /// + /// + Task> NewLabel(string name, string color, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/labels/{label_id}/ + /// + /// + /// + Task> DeleteLabel(long label_id, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/lists/ + /// + /// + Task>> MailingLists(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/{mail_id}/ + /// + /// + /// + Task> Retrieve(int mail_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/{mail_id}/ + /// + /// + /// + /// + /// + Task> Update(int mail_id, bool? is_read = null, int[] labels = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/mail/{mail_id}/ + /// + /// + /// + Task> Delete(int mail_id, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IMarketLogic.cs b/ESI.NET/Interfaces/Logic/IMarketLogic.cs new file mode 100644 index 0000000..8d12279 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IMarketLogic.cs @@ -0,0 +1,106 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Enumerations; +using ESI.NET.Models.Market; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IMarketLogic + { + /// + /// /markets/prices/ + /// + /// + Task>> Prices(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /markets/{region_id}/orders/ + /// + /// + /// + /// + /// + /// + Task>> RegionOrders( + int region_id, + MarketOrderType order_type = MarketOrderType.All, + int page = 1, + int? type_id = null, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /markets/{region_id}/history/ + /// + /// + /// + /// + Task>> TypeHistoryInRegion(int region_id, int type_id, + string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /markets/structures/{structure_id}/ + /// + /// + /// + /// + Task>> StructureOrders(long structure_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /markets/groups/ + /// + /// + Task> Groups(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /markets/groups/{market_group_id}/ + /// + /// + /// + Task> Group(int market_group_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/orders/ + /// + /// + Task>> CharacterOrders(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/orders/history/ + /// + /// + /// + Task>> CharacterOrderHistory(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /markets/{region_id}/types/ + /// + /// + /// + /// + Task> Types(int region_id, int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/orders/ + /// + /// + /// + Task>> CorporationOrders(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/orders/ + /// + /// + /// + Task>> CorporationOrderHistory(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IOpportunitiesLogic.cs b/ESI.NET/Interfaces/Logic/IOpportunitiesLogic.cs new file mode 100644 index 0000000..18205e3 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IOpportunitiesLogic.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IOpportunitiesLogic + { + /// + /// /opportunities/groups/ + /// + /// + Task> Groups(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /opportunities/groups/{group_id}/ + /// + /// + /// + Task> Group(int group_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /opportunities/tasks/ + /// + /// + Task> Tasks(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /opportunities/tasks/{task_id}/ + /// + /// + /// + Task> Task(int task_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/opportunities/ + /// + /// + /// + Task>> CompletedTasks(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IPlanetaryInteractionLogic.cs b/ESI.NET/Interfaces/Logic/IPlanetaryInteractionLogic.cs new file mode 100644 index 0000000..90af00e --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IPlanetaryInteractionLogic.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.PlanetaryInteraction; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IPlanetaryInteractionLogic + { + /// + /// /characters/{character_id}/planets/ + /// + /// + Task>> Colonies(string eTag = null, CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/planets/{planet_id}/ + /// + /// + /// + Task> ColonyLayout(int planet_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/customs_offices/ + /// + /// + Task>> CorporationCustomsOffices(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/schematics/{schematic_id}/ + /// + /// + /// + Task> SchematicInformation(int schematic_id, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IRoutesLogic.cs b/ESI.NET/Interfaces/Logic/IRoutesLogic.cs new file mode 100644 index 0000000..41ba9b0 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IRoutesLogic.cs @@ -0,0 +1,27 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Enumerations; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IRoutesLogic + { + /// + /// /route/{origin}/{destination}/ + /// + /// + /// + /// + /// + /// + /// + Task> Map( + int origin, + int destination, + RoutesFlag flag = RoutesFlag.Shortest, + int[] avoid = null, + int[] connections = null, + string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ISearchLogic.cs b/ESI.NET/Interfaces/Logic/ISearchLogic.cs new file mode 100644 index 0000000..890aa29 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ISearchLogic.cs @@ -0,0 +1,22 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Enumerations; +using ESI.NET.Models; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ISearchLogic + { + /// + /// /search/ and /characters/{character_id}/search/ + /// + /// The string to search on + /// Type of entities to search for + /// Whether the search should be a strict match + /// Language to use in the response + /// + Task> Query(SearchType type, string search, SearchCategory categories, + bool isStrict = false, string language = "en-us", string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ISkillsLogic.cs b/ESI.NET/Interfaces/Logic/ISkillsLogic.cs new file mode 100644 index 0000000..1f44461 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ISkillsLogic.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Skills; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ISkillsLogic + { + /// + /// /characters/{character_id}/attributes/ + /// + /// + Task> Attributes(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/skills/ + /// + /// + Task> List(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/skillqueue/ + /// + /// + Task>> Queue(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ISovereigntyLogic.cs b/ESI.NET/Interfaces/Logic/ISovereigntyLogic.cs new file mode 100644 index 0000000..8d165d3 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ISovereigntyLogic.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Sovereignty; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ISovereigntyLogic + { + /// + /// /sovereignty/campaigns/ + /// + /// + Task>> Campaigns(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /sovereignty/map/ + /// + /// + Task>> Systems(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /sovereignty/structures/ + /// + /// + Task>> Structures(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/ISsoLogic.cs b/ESI.NET/Interfaces/Logic/ISsoLogic.cs new file mode 100644 index 0000000..6d97be9 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/ISsoLogic.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Enumerations; +using ESI.NET.Models.SSO; + +namespace ESI.NET.Interfaces.Logic +{ + public interface ISsoLogic + { + /// + /// + /// + /// + /// + /// All hashing/encryption will be done automatically. Just provide the code. + /// + /// + string CreateAuthenticationUrl(List scope = null, string state = null, + string challengeCode = null); + + string GenerateChallengeCode(); + + /// + /// SSO Token helper + /// + /// + /// The authorization_code or the refresh_token + /// Provide the same value that was provided for codeChallenge in CreateAuthenticationUrl(). All hashing/encryption will be done automatically. Just provide the code. + /// + Task GetToken(GrantType grantType, string code, string codeChallenge = null, + CancellationToken cancellationToken = default); + + /// + /// SSO Token revokation helper + /// ESI will invalidate the provided refreshToken + /// + /// refresh_token to revoke + /// + Task RevokeToken(string code, CancellationToken cancellationToken = default); + + /// + /// Verifies the Character information for the provided Token information. + /// While this method represents the oauth/verify request, in addition to the verified data that ESI returns, this object also stores the Token and Refresh token + /// and this method also uses ESI retrieves other information pertinent to making calls in the ESI.NET API. (alliance_id, corporation_id, faction_id) + /// You will need a record in your database that stores at least this information. Serialize and store this object for quick retrieval and token refreshing. + /// + /// + /// + Task Verify(SsoToken token, CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IStatusLogic.cs b/ESI.NET/Interfaces/Logic/IStatusLogic.cs new file mode 100644 index 0000000..528e1ff --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IStatusLogic.cs @@ -0,0 +1,12 @@ +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Status; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IStatusLogic + { + Task> Retrieve(string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IUniverseLogic.cs b/ESI.NET/Interfaces/Logic/IUniverseLogic.cs new file mode 100644 index 0000000..866ec39 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IUniverseLogic.cs @@ -0,0 +1,237 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Universe; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IUniverseLogic + { + /// + /// /universe/bloodlines/ + /// + /// + Task>> Bloodlines(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/categories/ + /// + /// + Task> Categories(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/categories/{category_id}/ + /// + /// + /// + Task> Category(int category_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/constellations/ + /// + /// + Task> Constellations(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/constellations/{constellation_id}/ + /// + /// + /// + Task> Constellation(int constellation_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/factions/ + /// + /// + Task>> Factions(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/graphics/ + /// + /// + Task> Graphics(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/graphics/{graphic_id}/ + /// + /// + /// + Task> Graphic(int graphic_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/groups/ + /// + /// + /// + Task> Groups(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/groups/{group_id}/ + /// + /// + /// + Task> Group(int group_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/moons/{moon_id}/ + /// + /// + /// + Task> Moon(int moon_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/names/ + /// + /// The ids to resolve; Supported IDs for resolving are: Characters, Corporations, Alliances, Stations, Solar Systems, Constellations, Regions, Types. + /// + Task>> Names(List any_ids, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/ids/ + /// + /// Resolve a set of names to IDs in the following categories: agents, alliances, characters, constellations, corporations factions, inventory_types, regions, stations, and systems. Only exact matches will be returned. All names searched for are cached for 12 hours. + /// + Task> IDs(List names, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/planets/{planet_id}/ + /// + /// + /// + Task> Planet(int planet_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/races/ + /// + /// + Task>> Races(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/regions/ + /// + /// + Task> Regions(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/regions/{region_id}/ + /// + /// + /// + Task> Region(int region_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/stations/{station_id}/ + /// + /// + /// + Task> Station(int station_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/structures/ + /// + /// + Task> Structures(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/structures/{structure_id}/ + /// + /// + /// + Task> Structure(long structure_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/systems/ + /// + /// + Task> Systems(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/systems/{system_id}/ + /// + /// + /// + Task> System(int system_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/types/ + /// + /// + /// + Task> Types(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/types/{type_id}/ + /// + /// + /// + Task> Type(int type_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/stargates/{stargate_id}/ + /// + /// + /// + Task> Stargate(int stargate_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/system_jumps/ + /// + /// + Task>> Jumps(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/system_kills/ + /// + /// + Task>> Kills(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/stars/{star_id}/ + /// + /// + /// + Task> Star(int star_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/ancestries/ + /// + /// + Task>> Ancestries(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /universe/asteroid_belts/{asteroid_belt_id}/ + /// + /// + Task>> AsteroidBelt(int asteroid_belt_id, string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IUserInterfaceLogic.cs b/ESI.NET/Interfaces/Logic/IUserInterfaceLogic.cs new file mode 100644 index 0000000..766ef18 --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IUserInterfaceLogic.cs @@ -0,0 +1,51 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IUserInterfaceLogic + { + /// + /// /ui/openwindow/marketdetails/ + /// + /// + /// + Task> MarketDetails(int type_id, CancellationToken cancellationToken = default); + + /// + /// /ui/openwindow/contract/ + /// + /// + /// + Task> Contract(int contract_id, CancellationToken cancellationToken = default); + + /// + /// /ui/openwindow/information/ + /// + /// + /// + Task> Information(int target_id, CancellationToken cancellationToken = default); + + /// + /// /ui/autopilot/waypoint/ + /// + /// + /// + /// + /// + Task> Waypoint(long destination_id, bool add_to_beginning = false, + bool clear_other_waypoints = false, CancellationToken cancellationToken = default); + + /// + /// /ui/openwindow/newmail/ + /// + /// max length: 1000 + /// max length: 10000 + /// max: 50; this can be any of the following id types: character, corporation, alliance, mailing list; only multiple character ids can be specified + /// + /// + /// + Task> NewMail(string subject, string body, int[] recipients, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IWalletLogic.cs b/ESI.NET/Interfaces/Logic/IWalletLogic.cs new file mode 100644 index 0000000..1c3fafc --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IWalletLogic.cs @@ -0,0 +1,60 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Wallet; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IWalletLogic + { + /// + /// /characters/{character_id}/wallet/ + /// + /// + Task> CharacterWallet(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/wallet/journal/ + /// + /// + /// + Task>> CharacterJournal(int page = 1, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /characters/{character_id}/wallet/transactions/ + /// + /// + /// + Task>> CharacterTransactions(long from_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/wallets/ + /// + /// + Task>> CorporationWallets(string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/wallets/{division}/journal/ + /// + /// + /// + /// + Task>> CorporationJournal(int division, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /corporations/{corporation_id}/wallets/{division}/transactions/ + /// + /// + /// + /// + Task>> CorporationTransactions(int division, long from_id, + string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Interfaces/Logic/IWarsLogic.cs b/ESI.NET/Interfaces/Logic/IWarsLogic.cs new file mode 100644 index 0000000..73b08aa --- /dev/null +++ b/ESI.NET/Interfaces/Logic/IWarsLogic.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using ESI.NET.Models.Wars; + +namespace ESI.NET.Interfaces.Logic +{ + public interface IWarsLogic + { + /// + /// /wars/ + /// + /// Only return wars with ID smaller than this + /// + Task> All(long max_war_id = 0, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /wars/{warId}/ + /// + /// + /// + Task> Information(int war_id, string eTag = null, + CancellationToken cancellationToken = default); + + /// + /// /wars/{warId}/killmails/ + /// + /// + /// + /// + Task>> Kills(int war_id, int page = 1, + string eTag = null, + CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/ESI.NET/Logic/AllianceLogic.cs b/ESI.NET/Logic/AllianceLogic.cs index b2e1467..4c48e8a 100644 --- a/ESI.NET/Logic/AllianceLogic.cs +++ b/ESI.NET/Logic/AllianceLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class AllianceLogic + public class AllianceLogic : IAllianceLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -41,7 +42,7 @@ public async Task> Information(int alliance_id, string eTa cancellationToken: cancellationToken, replacements: new Dictionary() { - { "alliance_id", alliance_id.ToString() } + {"alliance_id", alliance_id.ToString()} }); /// @@ -57,7 +58,7 @@ public async Task> Corporations(int alliance_id, string eTag cancellationToken: cancellationToken, replacements: new Dictionary() { - { "alliance_id", alliance_id.ToString() } + {"alliance_id", alliance_id.ToString()} }); /// @@ -73,7 +74,7 @@ public async Task> Icons(int alliance_id, string eTag = null cancellationToken: cancellationToken, replacements: new Dictionary() { - { "alliance_id", alliance_id.ToString() } + {"alliance_id", alliance_id.ToString()} }); } } \ No newline at end of file diff --git a/ESI.NET/Logic/AssetsLogic.cs b/ESI.NET/Logic/AssetsLogic.cs index 0bedda8..75d425a 100644 --- a/ESI.NET/Logic/AssetsLogic.cs +++ b/ESI.NET/Logic/AssetsLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class AssetsLogic + public class AssetsLogic : IAssetsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -41,7 +42,7 @@ public async Task>> ForCharacter(int page = 1, string eTa cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -55,13 +56,13 @@ public async Task>> ForCharacter(int page = 1, string eTa /// /// public async Task>> LocationsForCharacter(List item_ids, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/assets/locations/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, body: item_ids.ToArray(), token: _data.Token); @@ -78,7 +79,7 @@ public async Task>> NamesForCharacter(List item cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, body: item_ids.ToArray(), token: _data.Token); @@ -97,7 +98,7 @@ public async Task>> ForCorporation(int page = 1, string e cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -117,7 +118,7 @@ public async Task>> LocationsForCorporation(List< cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, body: item_ids.ToArray(), token: _data.Token); @@ -127,13 +128,14 @@ public async Task>> LocationsForCorporation(List< /// /// /// - public async Task>> NamesForCorporation(List item_ids, CancellationToken cancellationToken = default) + public async Task>> NamesForCorporation(List item_ids, + CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/corporations/{corporation_id}/assets/names/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, body: item_ids.ToArray(), token: _data.Token); diff --git a/ESI.NET/Logic/BookmarksLogic.cs b/ESI.NET/Logic/BookmarksLogic.cs index 42c95af..0128eed 100644 --- a/ESI.NET/Logic/BookmarksLogic.cs +++ b/ESI.NET/Logic/BookmarksLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class BookmarksLogic + public class BookmarksLogic : IBookmarksLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -42,7 +43,7 @@ public async Task>> ForCharacter(int page = 1, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -62,7 +63,7 @@ public async Task>> FoldersForCharacter(int page = 1, s cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -82,7 +83,7 @@ public async Task>> ForCorporation(int page = 1, stri cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -102,7 +103,7 @@ public async Task>> FoldersForCorporation(int page = 1, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { diff --git a/ESI.NET/Logic/CalendarLogic.cs b/ESI.NET/Logic/CalendarLogic.cs index 83db6a7..9c2909f 100644 --- a/ESI.NET/Logic/CalendarLogic.cs +++ b/ESI.NET/Logic/CalendarLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class CalendarLogic + public class CalendarLogic : ICalendarLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -38,7 +39,7 @@ public async Task>> Events(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -55,8 +56,8 @@ public async Task> Event(int event_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "event_id", event_id.ToString() } + {"character_id", character_id.ToString()}, + {"event_id", event_id.ToString()} }, token: _data.Token); @@ -73,8 +74,8 @@ public async Task> Respond(int event_id, EventResponse eventR cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "event_id", event_id.ToString() } + {"character_id", character_id.ToString()}, + {"event_id", event_id.ToString()} }, body: new { @@ -95,8 +96,8 @@ public async Task>> Responses(int event_id, string eT cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "event_id", event_id.ToString() } + {"character_id", character_id.ToString()}, + {"event_id", event_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/CharacterLogic.cs b/ESI.NET/Logic/CharacterLogic.cs index eeb017a..f2bf2e5 100644 --- a/ESI.NET/Logic/CharacterLogic.cs +++ b/ESI.NET/Logic/CharacterLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class CharacterLogic + public class CharacterLogic : ICharacterLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -67,7 +68,7 @@ public async Task> Information(int character_id, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }); /// @@ -82,7 +83,7 @@ public async Task>> AgentsResearch(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -99,7 +100,7 @@ public async Task>> Blueprints(int page = 1, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token, parameters: new string[] @@ -119,7 +120,7 @@ public async Task>> ChatChannels(string eTag = nul cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -128,7 +129,8 @@ public async Task>> ChatChannels(string eTag = nul /// /// /// - public async Task>> CorporationHistory(int character_id, string eTag = null, + public async Task>> CorporationHistory(int character_id, + string eTag = null, CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/characters/{character_id}/corporationhistory/", @@ -136,7 +138,7 @@ public async Task>> CorporationHistory(int cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }); /// @@ -144,13 +146,14 @@ public async Task>> CorporationHistory(int /// /// The target characters to calculate the charge for /// - public async Task> CSPA(object character_ids, CancellationToken cancellationToken = default) + public async Task> CSPA(object character_ids, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/characters/{character_id}/cspa/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, body: character_ids, token: _data.Token); @@ -167,7 +170,7 @@ public async Task> Fatigue(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -183,7 +186,7 @@ public async Task>> Medals(string eTag = null, cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -199,7 +202,7 @@ public async Task>> Notifications(string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -212,7 +215,7 @@ public async Task>> ContactNotifications() "/characters/{character_id}/notifications/contacts/", replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -226,7 +229,7 @@ public async Task> Portrait(int character_id) "/characters/{character_id}/portrait/", replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }); /// @@ -238,7 +241,7 @@ public async Task> Roles() "/characters/{character_id}/roles/", replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -251,7 +254,7 @@ public async Task>> Standings() "/characters/{character_id}/standings/", replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -264,7 +267,7 @@ public async Task>> Titles() "/characters/{character_id}/titles/", replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/ClonesLogic.cs b/ESI.NET/Logic/ClonesLogic.cs index e453cc4..0fd97f1 100644 --- a/ESI.NET/Logic/ClonesLogic.cs +++ b/ESI.NET/Logic/ClonesLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class ClonesLogic + public class ClonesLogic : IClonesLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -37,7 +38,7 @@ public async Task> List(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -53,7 +54,7 @@ public async Task> Implants(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/ContactsLogic.cs b/ESI.NET/Logic/ContactsLogic.cs index 52d3757..09d728a 100644 --- a/ESI.NET/Logic/ContactsLogic.cs +++ b/ESI.NET/Logic/ContactsLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class ContactsLogic + public class ContactsLogic : IContactsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -44,7 +45,7 @@ public async Task>> ListForCharacter(int page = 1, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -65,7 +66,7 @@ public async Task>> ListForCorporation(int page = 1, s cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -86,7 +87,7 @@ public async Task>> ListForAlliance(int page = 1, stri cancellationToken: cancellationToken, replacements: new Dictionary() { - { "alliance_id", alliance_id.ToString() } + {"alliance_id", alliance_id.ToString()} }, parameters: new string[] { @@ -103,11 +104,11 @@ public async Task>> ListForAlliance(int page = 1, stri /// /// public async Task> Add(int[] contact_ids, decimal standing, int[] label_ids = null, - bool? watched = null,CancellationToken cancellationToken = default) + bool? watched = null, CancellationToken cancellationToken = default) { var body = contact_ids; - var parameters = new List() { $"standing={standing}" }; + var parameters = new List() {$"standing={standing}"}; if (label_ids != null) parameters.Add($"label_ids={string.Join(",", label_ids)}"); @@ -120,7 +121,7 @@ public async Task> Add(int[] contact_ids, decimal standing, i cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: parameters.ToArray(), body: body, @@ -140,7 +141,7 @@ public async Task> Update(int[] contact_ids, decimal standin { var body = contact_ids; - var parameters = new List() { $"standing={standing}" }; + var parameters = new List() {$"standing={standing}"}; if (label_ids != null) parameters.Add($"label_ids={string.Join(",", label_ids)}"); @@ -153,7 +154,7 @@ public async Task> Update(int[] contact_ids, decimal standin cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: parameters.ToArray(), body: body, @@ -171,7 +172,7 @@ public async Task> Delete(int[] contact_ids, CancellationTok cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -191,7 +192,7 @@ public async Task>> LabelsForCharacter(string eTag = nul cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -207,7 +208,7 @@ public async Task>> LabelsForCorporation(string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -220,7 +221,7 @@ public async Task>> LabelsForAlliance() "/alliances/{alliance_id}/contacts/labels/", replacements: new Dictionary() { - { "alliance_id", alliance_id.ToString() } + {"alliance_id", alliance_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/ContractsLogic.cs b/ESI.NET/Logic/ContractsLogic.cs index 3db04d7..2f90603 100644 --- a/ESI.NET/Logic/ContractsLogic.cs +++ b/ESI.NET/Logic/ContractsLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class ContractsLogic + public class ContractsLogic : IContractsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -41,7 +42,7 @@ public async Task>> Contracts(int region_id, int page cancellationToken: cancellationToken, replacements: new Dictionary() { - { "region_id", region_id.ToString() } + {"region_id", region_id.ToString()} }, parameters: new string[] { @@ -62,7 +63,7 @@ public async Task>> ContractItems(int contract_id cancellationToken: cancellationToken, replacements: new Dictionary() { - { "contract_id", contract_id.ToString() } + {"contract_id", contract_id.ToString()} }, parameters: new string[] { @@ -82,7 +83,7 @@ public async Task>> ContractBids(int contract_id, int page cancellationToken: cancellationToken, replacements: new Dictionary() { - { "contract_id", contract_id.ToString() } + {"contract_id", contract_id.ToString()} }, parameters: new string[] { @@ -101,7 +102,7 @@ public async Task>> CharacterContracts(int page = 1, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -122,8 +123,8 @@ public async Task>> CharacterContractItems(int co cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "contract_id", contract_id.ToString() } + {"character_id", character_id.ToString()}, + {"contract_id", contract_id.ToString()} }, parameters: new string[] { @@ -144,8 +145,8 @@ public async Task>> CharacterContractBids(int contract_id, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "contract_id", contract_id.ToString() } + {"character_id", character_id.ToString()}, + {"contract_id", contract_id.ToString()} }, parameters: new string[] { @@ -165,7 +166,7 @@ public async Task>> CorporationContracts(int page = 1 cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -187,8 +188,8 @@ public async Task>> CorporationContractItems(int cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() }, - { "contract_id", contract_id.ToString() } + {"corporation_id", corporation_id.ToString()}, + {"contract_id", contract_id.ToString()} }, parameters: new string[] { @@ -201,7 +202,8 @@ public async Task>> CorporationContractItems(int /// /// /// - public async Task>> CorporationContractBids(int contract_id, int page = 1, string eTag = null, + public async Task>> CorporationContractBids(int contract_id, int page = 1, + string eTag = null, CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/corporations/{corporation_id}/contracts/{contract_id}/bids/", @@ -209,8 +211,8 @@ public async Task>> CorporationContractBids(int contract_i cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() }, - { "contract_id", contract_id.ToString() } + {"corporation_id", corporation_id.ToString()}, + {"contract_id", contract_id.ToString()} }, parameters: new string[] { diff --git a/ESI.NET/Logic/CorporationLogic.cs b/ESI.NET/Logic/CorporationLogic.cs index 514362a..50e7140 100644 --- a/ESI.NET/Logic/CorporationLogic.cs +++ b/ESI.NET/Logic/CorporationLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class CorporationLogic + public class CorporationLogic : ICorporationLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -50,7 +51,7 @@ public async Task> Information(int corporation_id, stri cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }); /// @@ -66,7 +67,7 @@ public async Task>> AllianceHistory(int corpor cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }); /// @@ -82,7 +83,7 @@ public async Task>> Blueprints(int page = 1, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -103,7 +104,7 @@ public async Task>> ContainerLogs(int page = 1, s cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -123,7 +124,7 @@ public async Task> Divisions(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -139,7 +140,7 @@ public async Task>> Facilities(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -156,7 +157,7 @@ public async Task> Icons(int corporation_id, string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }); /// @@ -172,7 +173,7 @@ public async Task>> Medals(int page = 1, string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { $"page={page}" @@ -192,7 +193,7 @@ public async Task>> MedalsIssued(int page = 1, str cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -212,7 +213,7 @@ public async Task> Members(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -228,7 +229,7 @@ public async Task> MemberLimit(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -244,7 +245,7 @@ public async Task>> MemberTitles(string eTag = nu cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -260,7 +261,7 @@ public async Task>> MemberTracking(string eTag = nu cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -276,7 +277,7 @@ public async Task>> Roles(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -292,7 +293,7 @@ public async Task>> RolesHistory(string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -309,7 +310,7 @@ public async Task>> Shareholders(int page = 1, str cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { $"page={page}" @@ -329,7 +330,7 @@ public async Task> Standings(int page = 1, string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -350,7 +351,7 @@ public async Task>> Starbases(int page = 1, string eT cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -372,8 +373,8 @@ public async Task> Starbase(long starbase_id, int syst cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() }, - { "starbase_id", starbase_id.ToString() } + {"corporation_id", corporation_id.ToString()}, + {"starbase_id", starbase_id.ToString()} }, parameters: new string[] { @@ -393,7 +394,7 @@ public async Task>> Structures(int page = 1, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -413,7 +414,7 @@ public async Task>> Titles(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/DogmaLogic.cs b/ESI.NET/Logic/DogmaLogic.cs index 27c8c66..d63f9a3 100644 --- a/ESI.NET/Logic/DogmaLogic.cs +++ b/ESI.NET/Logic/DogmaLogic.cs @@ -3,11 +3,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class DogmaLogic + public class DogmaLogic : IDogmaLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -68,7 +69,7 @@ public async Task> Effect(int effect_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "effect_id", effect_id.ToString() } + {"effect_id", effect_id.ToString()} }); /// @@ -85,8 +86,8 @@ public async Task> DynamicItem(int type_id, long item_id, st cancellationToken: cancellationToken, replacements: new Dictionary() { - { "type_id", type_id.ToString() }, - { "item_id", item_id.ToString() } + {"type_id", type_id.ToString()}, + {"item_id", item_id.ToString()} }); } } \ No newline at end of file diff --git a/ESI.NET/Logic/FactionWarfareLogic.cs b/ESI.NET/Logic/FactionWarfareLogic.cs index dec9fa6..9135dd7 100644 --- a/ESI.NET/Logic/FactionWarfareLogic.cs +++ b/ESI.NET/Logic/FactionWarfareLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class FactionWarfareLogic + public class FactionWarfareLogic : IFactionWarfareLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -104,7 +105,7 @@ public async Task> StatsForCorporation(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -120,7 +121,7 @@ public async Task> StatsForCharacter(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/FittingsLogic.cs b/ESI.NET/Logic/FittingsLogic.cs index f708ff1..bc16a41 100644 --- a/ESI.NET/Logic/FittingsLogic.cs +++ b/ESI.NET/Logic/FittingsLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class FittingsLogic + public class FittingsLogic : IFittingsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -37,7 +38,7 @@ public async Task>> List(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -52,7 +53,7 @@ public async Task> Add(object fitting, CancellationToken cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, body: fitting, token: _data.Token); @@ -68,8 +69,8 @@ public async Task> Delete(int fitting_id, CancellationToken cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "fitting_id", fitting_id.ToString() } + {"character_id", character_id.ToString()}, + {"fitting_id", fitting_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/FleetsLogic.cs b/ESI.NET/Logic/FleetsLogic.cs index 368ec7e..1b6612a 100644 --- a/ESI.NET/Logic/FleetsLogic.cs +++ b/ESI.NET/Logic/FleetsLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class FleetsLogic + public class FleetsLogic : IFleetsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -39,7 +40,7 @@ public async Task> Settings(long fleet_id, string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() } + {"fleet_id", fleet_id.ToString()} }, token: _data.Token); @@ -57,7 +58,7 @@ public async Task> UpdateSettings(long fleet_id, string motd cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() } + {"fleet_id", fleet_id.ToString()} }, body: BuildUpdateSettingsObject(motd, is_free_move), token: _data.Token); @@ -66,14 +67,15 @@ public async Task> UpdateSettings(long fleet_id, string motd /// /characters/{character_id}/fleet/ /// /// - public async Task> FleetInfo(string eTag = null, CancellationToken cancellationToken = default) + public async Task> FleetInfo(string eTag = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/fleet/", eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -82,14 +84,15 @@ public async Task> FleetInfo(string eTag = null, Cancella /// /// /// - public async Task>> Members(long fleet_id, string eTag = null, CancellationToken cancellationToken = default) + public async Task>> Members(long fleet_id, string eTag = null, + CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/fleets/{fleet_id}/members/", eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() } + {"fleet_id", fleet_id.ToString()} }, token: _data.Token); @@ -109,7 +112,7 @@ public async Task> InviteCharacter(long fleet_id, int charac cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() } + {"fleet_id", fleet_id.ToString()} }, body: BuildFleetInviteObject(character_id, role, wing_id, squad_id), token: _data.Token); @@ -130,8 +133,8 @@ public async Task> MoveCharacter(long fleet_id, int member_i cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "member_id", member_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"member_id", member_id.ToString()} }, body: BuildFleetInviteObject(character_id, role, wing_id, squad_id), token: _data.Token); @@ -142,14 +145,15 @@ public async Task> MoveCharacter(long fleet_id, int member_i /// /// /// - public async Task> KickCharacter(long fleet_id, int member_id, CancellationToken cancellationToken = default) + public async Task> KickCharacter(long fleet_id, int member_id, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/fleets/{fleet_id}/members/{member_id}/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "member_id", member_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"member_id", member_id.ToString()} }, token: _data.Token); @@ -158,14 +162,15 @@ public async Task> KickCharacter(long fleet_id, int member_i /// /// /// - public async Task>> Wings(long fleet_id, string eTag = null, CancellationToken cancellationToken = default) + public async Task>> Wings(long fleet_id, string eTag = null, + CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/fleets/{fleet_id}/wings/", eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() } + {"fleet_id", fleet_id.ToString()} }, token: _data.Token); @@ -180,7 +185,7 @@ public async Task> CreateWing(long fleet_id, CancellationTo cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() } + {"fleet_id", fleet_id.ToString()} }, token: _data.Token); @@ -191,14 +196,15 @@ public async Task> CreateWing(long fleet_id, CancellationTo /// /// /// - public async Task> RenameWing(long fleet_id, long wing_id, string name, CancellationToken cancellationToken = default) + public async Task> RenameWing(long fleet_id, long wing_id, string name, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/fleets/{fleet_id}/wings/{wing_id}/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "wing_id", wing_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"wing_id", wing_id.ToString()} }, body: new { @@ -212,14 +218,15 @@ public async Task> RenameWing(long fleet_id, long wing_id, s /// /// /// - public async Task> DeleteWing(long fleet_id, long wing_id, CancellationToken cancellationToken = default) + public async Task> DeleteWing(long fleet_id, long wing_id, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/fleets/{fleet_id}/wings/{wing_id}/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "wing_id", wing_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"wing_id", wing_id.ToString()} }, token: _data.Token); @@ -229,14 +236,15 @@ public async Task> DeleteWing(long fleet_id, long wing_id, C /// /// /// - public async Task> CreateSquad(long fleet_id, long wing_id, CancellationToken cancellationToken = default) + public async Task> CreateSquad(long fleet_id, long wing_id, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Post, "/fleets/{fleet_id}/wings/{wing_id}/squads/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "wing_id", wing_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"wing_id", wing_id.ToString()} }, token: _data.Token); @@ -247,14 +255,15 @@ public async Task> CreateSquad(long fleet_id, long wing_id /// /// /// - public async Task> RenameSquad(long fleet_id, long squad_id, string name, CancellationToken cancellationToken = default) + public async Task> RenameSquad(long fleet_id, long squad_id, string name, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/fleets/{fleet_id}/squads/{squad_id}/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "squad_id", squad_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"squad_id", squad_id.ToString()} }, body: new { name @@ -266,14 +275,15 @@ public async Task> RenameSquad(long fleet_id, long squad_id, /// /// /// - public async Task> DeleteSquad(long fleet_id, long squad_id, CancellationToken cancellationToken = default) + public async Task> DeleteSquad(long fleet_id, long squad_id, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Delete, "/fleets/{fleet_id}/squads/{squad_id}/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "fleet_id", fleet_id.ToString() }, - { "squad_id", squad_id.ToString() } + {"fleet_id", fleet_id.ToString()}, + {"squad_id", squad_id.ToString()} }, token: _data.Token); /// @@ -287,11 +297,11 @@ private static dynamic BuildUpdateSettingsObject(string motd, bool? is_free_move dynamic body = null; if (motd != null) - body = new { motd }; + body = new {motd}; if (is_free_move != null) - body = new { is_free_move }; + body = new {is_free_move}; if (motd != null && is_free_move != null) - body = new { motd, is_free_move }; + body = new {motd, is_free_move}; return body; } @@ -310,13 +320,13 @@ private static dynamic BuildFleetInviteObject(int character_id, FleetRole role, dynamic body = null; if (role == FleetRole.FleetCommander) - body = new { character_id, role = role.ToEsiValue() }; + body = new {character_id, role = role.ToEsiValue()}; else if (role == FleetRole.WingCommander) - body = new { character_id, role = role.ToEsiValue(), wing_id }; + body = new {character_id, role = role.ToEsiValue(), wing_id}; else if (role == FleetRole.SquadCommander || role == FleetRole.SquadMember) - body = new { character_id, role = role.ToEsiValue(), wing_id, squad_id }; + body = new {character_id, role = role.ToEsiValue(), wing_id, squad_id}; return body; } diff --git a/ESI.NET/Logic/IncursionsLogic.cs b/ESI.NET/Logic/IncursionsLogic.cs index 2a15874..1dbb835 100644 --- a/ESI.NET/Logic/IncursionsLogic.cs +++ b/ESI.NET/Logic/IncursionsLogic.cs @@ -3,11 +3,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class IncursionsLogic + public class IncursionsLogic : IIncursionsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; diff --git a/ESI.NET/Logic/IndustryLogic.cs b/ESI.NET/Logic/IndustryLogic.cs index d8ef313..a2f7728 100644 --- a/ESI.NET/Logic/IndustryLogic.cs +++ b/ESI.NET/Logic/IndustryLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class IndustryLogic + public class IndustryLogic : IIndustryLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -63,7 +64,7 @@ public async Task>> JobsForCharacter(bool include_complete cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -84,7 +85,7 @@ public async Task>> MiningLedger(int page = 1, string eT cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -105,7 +106,7 @@ public async Task>> Observers(int page = 1, string eT cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -128,8 +129,8 @@ public async Task>> ObservedMining(long observer_ cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() }, - { "observer_id", observer_id.ToString() } + {"corporation_id", corporation_id.ToString()}, + {"observer_id", observer_id.ToString()} }, parameters: new string[] { @@ -152,7 +153,7 @@ public async Task>> JobsForCorporation(bool include_comple cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -173,7 +174,7 @@ public async Task>> Extractions(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/InsuranceLogic.cs b/ESI.NET/Logic/InsuranceLogic.cs index 3dc8848..426dab8 100644 --- a/ESI.NET/Logic/InsuranceLogic.cs +++ b/ESI.NET/Logic/InsuranceLogic.cs @@ -3,11 +3,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class InsuranceLogic + public class InsuranceLogic : IInsuranceLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -25,7 +26,7 @@ public InsuranceLogic(HttpClient client, EsiConfig config) public async Task>> Levels(string eTag = null, CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, - "/insurance/prices/", + "/insurance/prices/", eTag: eTag, cancellationToken: cancellationToken); } diff --git a/ESI.NET/Logic/KillmailsLogic.cs b/ESI.NET/Logic/KillmailsLogic.cs index 5ea3588..308e373 100644 --- a/ESI.NET/Logic/KillmailsLogic.cs +++ b/ESI.NET/Logic/KillmailsLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class KillmailsLogic + public class KillmailsLogic : IKillmailsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -41,7 +42,7 @@ public async Task>> ForCharacter(int page = 1, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -62,7 +63,7 @@ public async Task>> ForCorporation(int page = 1, stri cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -85,8 +86,8 @@ public async Task> Information(string killmail_hash, in cancellationToken: cancellationToken, replacements: new Dictionary() { - { "killmail_id", killmail_id.ToString() }, - { "killmail_hash", killmail_hash.ToString() } + {"killmail_id", killmail_id.ToString()}, + {"killmail_hash", killmail_hash.ToString()} }); } } \ No newline at end of file diff --git a/ESI.NET/Logic/LocationLogic.cs b/ESI.NET/Logic/LocationLogic.cs index 1c57942..2ca5921 100644 --- a/ESI.NET/Logic/LocationLogic.cs +++ b/ESI.NET/Logic/LocationLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class LocationLogic + public class LocationLogic : ILocationLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -29,14 +30,15 @@ public LocationLogic(HttpClient client, EsiConfig config, AuthorizedCharacterDat /// /characters/{character_id}/location/ /// /// - public async Task> Location(string eTag = null, CancellationToken cancellationToken = default) + public async Task> Location(string eTag = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/location/", eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -51,7 +53,7 @@ public async Task> Ship(string eTag = null, CancellationToken cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -59,14 +61,15 @@ public async Task> Ship(string eTag = null, CancellationToken /// /characters/{character_id}/online/ /// /// - public async Task> Online(string eTag = null, CancellationToken cancellationToken = default) + public async Task> Online(string eTag = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/online/", eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/LoyaltyLogic.cs b/ESI.NET/Logic/LoyaltyLogic.cs index ee9ce5a..73a4079 100644 --- a/ESI.NET/Logic/LoyaltyLogic.cs +++ b/ESI.NET/Logic/LoyaltyLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class LoyaltyLogic + public class LoyaltyLogic : ILoyaltyLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -37,7 +38,7 @@ public async Task>> Offers(int corporation_id, string eT cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }); /// @@ -52,7 +53,7 @@ public async Task>> Points(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/MailLogic.cs b/ESI.NET/Logic/MailLogic.cs index b3ba0bd..4a4ece5 100644 --- a/ESI.NET/Logic/MailLogic.cs +++ b/ESI.NET/Logic/MailLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class MailLogic + public class MailLogic : IMailLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -47,7 +48,7 @@ public async Task>> Headers(long[] labels = null, int l cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: parameters.ToArray(), token: _data.Token); @@ -70,7 +71,7 @@ public async Task> New(object[] recipients, string subject, str cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, body: new { @@ -93,7 +94,7 @@ public async Task> Labels(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -110,7 +111,7 @@ public async Task> NewLabel(string name, string color, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, body: new { @@ -130,8 +131,8 @@ public async Task> DeleteLabel(long label_id, CancellationTo cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "label_id", label_id.ToString() } + {"character_id", character_id.ToString()}, + {"label_id", label_id.ToString()} }, token: _data.Token); @@ -147,7 +148,7 @@ public async Task>> MailingLists(string eTag = nul cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -164,8 +165,8 @@ public async Task> Retrieve(int mail_id, string eTag = null cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "mail_id", mail_id.ToString() } + {"character_id", character_id.ToString()}, + {"mail_id", mail_id.ToString()} }, token: _data.Token); @@ -176,14 +177,15 @@ public async Task> Retrieve(int mail_id, string eTag = null /// /// /// - public async Task> Update(int mail_id, bool? is_read = null, int[] labels = null, CancellationToken cancellationToken = default) + public async Task> Update(int mail_id, bool? is_read = null, int[] labels = null, + CancellationToken cancellationToken = default) => await Execute(_client, _config, RequestSecurity.Authenticated, HttpMethod.Put, "/characters/{character_id}/mail/{mail_id}/", cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "mail_id", mail_id.ToString() } + {"character_id", character_id.ToString()}, + {"mail_id", mail_id.ToString()} }, body: BuildUpdateObject(is_read, labels), token: _data.Token); @@ -199,8 +201,8 @@ public async Task> Delete(int mail_id, CancellationToken ca cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "mail_id", mail_id.ToString() } + {"character_id", character_id.ToString()}, + {"mail_id", mail_id.ToString()} }, token: _data.Token); @@ -215,11 +217,11 @@ private static dynamic BuildUpdateObject(bool? is_read, int[] labels = null) dynamic body = null; if (is_read != null && labels == null) - body = new { is_read }; + body = new {is_read}; else if (is_read == null && labels != null) - body = new { labels }; + body = new {labels}; else - body = new { is_read, labels }; + body = new {is_read, labels}; return body; } } diff --git a/ESI.NET/Logic/MarketLogic.cs b/ESI.NET/Logic/MarketLogic.cs index d21ef82..1e6c4ad 100644 --- a/ESI.NET/Logic/MarketLogic.cs +++ b/ESI.NET/Logic/MarketLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class MarketLogic + public class MarketLogic : IMarketLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -56,7 +57,7 @@ public async Task>> RegionOrders( string eTag = null, CancellationToken cancellationToken = default) { - var parameters = new List() { $"order_type={order_type.ToEsiValue()}" }; + var parameters = new List() {$"order_type={order_type.ToEsiValue()}"}; parameters.Add($"page={page}"); if (type_id != null) @@ -68,7 +69,7 @@ public async Task>> RegionOrders( cancellationToken: cancellationToken, replacements: new Dictionary() { - { "region_id", region_id.ToString() } + {"region_id", region_id.ToString()} }, parameters: parameters.ToArray()); @@ -89,7 +90,7 @@ public async Task>> TypeHistoryInRegion(int region_i cancellationToken: cancellationToken, replacements: new Dictionary() { - { "region_id", region_id.ToString() } + {"region_id", region_id.ToString()} }, parameters: new string[] { @@ -110,7 +111,7 @@ public async Task>> StructureOrders(long structure_id, i cancellationToken: cancellationToken, replacements: new Dictionary() { - { "structure_id", structure_id.ToString() } + {"structure_id", structure_id.ToString()} }, parameters: new string[] { @@ -140,7 +141,7 @@ public async Task> Group(int market_group_id, string eTag = n cancellationToken: cancellationToken, replacements: new Dictionary() { - { "market_group_id", market_group_id.ToString() } + {"market_group_id", market_group_id.ToString()} }); /// @@ -155,7 +156,7 @@ public async Task>> CharacterOrders(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -172,7 +173,7 @@ public async Task>> CharacterOrderHistory(int page = 1, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -194,7 +195,7 @@ public async Task> Types(int region_id, int page = 1, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "region_id", region_id.ToString() } + {"region_id", region_id.ToString()} }, parameters: new string[] { @@ -214,7 +215,7 @@ public async Task>> CorporationOrders(int page = 1, stri cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { @@ -235,7 +236,7 @@ public async Task>> CorporationOrderHistory(int page = 1 cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, parameters: new string[] { diff --git a/ESI.NET/Logic/OpportunitiesLogic.cs b/ESI.NET/Logic/OpportunitiesLogic.cs index 9af9ba8..f566c46 100644 --- a/ESI.NET/Logic/OpportunitiesLogic.cs +++ b/ESI.NET/Logic/OpportunitiesLogic.cs @@ -3,12 +3,13 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; using opportunities = ESI.NET.Models.Opportunities; namespace ESI.NET.Logic { - public class OpportunitiesLogic + public class OpportunitiesLogic : IOpportunitiesLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -47,7 +48,7 @@ public async Task> Groups(string eTag = null, CancellationTok cancellationToken: cancellationToken, replacements: new Dictionary() { - { "group_id", group_id.ToString() } + {"group_id", group_id.ToString()} }); /// @@ -73,7 +74,7 @@ public async Task> Tasks(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "task_id", task_id.ToString() } + {"task_id", task_id.ToString()} }); /// @@ -89,7 +90,7 @@ public async Task> Tasks(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/PlanetaryInteractionLogic.cs b/ESI.NET/Logic/PlanetaryInteractionLogic.cs index 9a692d4..7d2a0d0 100644 --- a/ESI.NET/Logic/PlanetaryInteractionLogic.cs +++ b/ESI.NET/Logic/PlanetaryInteractionLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class PlanetaryInteractionLogic + public class PlanetaryInteractionLogic : IPlanetaryInteractionLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -32,14 +33,15 @@ public PlanetaryInteractionLogic(HttpClient client, EsiConfig config, Authorized /// /characters/{character_id}/planets/ /// /// - public async Task>> Colonies(string eTag = null, CancellationToken cancellationToken = default) + public async Task>> Colonies(string eTag = null, + CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Authenticated, HttpMethod.Get, "/characters/{character_id}/planets/", eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -56,8 +58,8 @@ public async Task> ColonyLayout(int planet_id, string cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() }, - { "planet_id", planet_id.ToString() } + {"character_id", character_id.ToString()}, + {"planet_id", planet_id.ToString()} }, token: _data.Token); @@ -73,7 +75,7 @@ public async Task>> CorporationCustomsOffices(st cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -90,7 +92,7 @@ public async Task> SchematicInformation(int schematic_id, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "schematic_id", schematic_id.ToString() } + {"schematic_id", schematic_id.ToString()} }); } } \ No newline at end of file diff --git a/ESI.NET/Logic/RoutesLogic.cs b/ESI.NET/Logic/RoutesLogic.cs index a69667a..0b9bfb7 100644 --- a/ESI.NET/Logic/RoutesLogic.cs +++ b/ESI.NET/Logic/RoutesLogic.cs @@ -3,11 +3,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class RoutesLogic + public class RoutesLogic : IRoutesLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -32,11 +33,11 @@ public async Task> Map( int destination, RoutesFlag flag = RoutesFlag.Shortest, int[] avoid = null, - int[] connections = null, + int[] connections = null, string eTag = null, CancellationToken cancellationToken = default) { - var parameters = new List() { $"flag={flag.ToEsiValue()}" }; + var parameters = new List() {$"flag={flag.ToEsiValue()}"}; if (avoid != null) parameters.Add($"&avoid={string.Join(",", avoid)}"); @@ -50,8 +51,8 @@ public async Task> Map( cancellationToken: cancellationToken, replacements: new Dictionary() { - { "origin", origin.ToString() }, - { "destination", destination.ToString() } + {"origin", origin.ToString()}, + {"destination", destination.ToString()} }, parameters: parameters.ToArray()); diff --git a/ESI.NET/Logic/SearchLogic.cs b/ESI.NET/Logic/SearchLogic.cs index 083fe45..f0ada71 100644 --- a/ESI.NET/Logic/SearchLogic.cs +++ b/ESI.NET/Logic/SearchLogic.cs @@ -5,11 +5,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class SearchLogic + public class SearchLogic : ISearchLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -35,7 +36,8 @@ public SearchLogic(HttpClient client, EsiConfig config, AuthorizedCharacterData /// Language to use in the response /// public async Task> Query(SearchType type, string search, SearchCategory categories, - bool isStrict = false, string language = "en-us", string eTag = null, CancellationToken cancellationToken = default) + bool isStrict = false, string language = "en-us", string eTag = null, + CancellationToken cancellationToken = default) { var categoryList = categories.ToEsiValue(); @@ -47,7 +49,7 @@ public async Task> Query(SearchType type, string sear security = RequestSecurity.Authenticated; replacements = new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }; endpoint = "/characters/{character_id}/search/"; } diff --git a/ESI.NET/Logic/SkillsLogic.cs b/ESI.NET/Logic/SkillsLogic.cs index ed84cb7..ba4ced6 100644 --- a/ESI.NET/Logic/SkillsLogic.cs +++ b/ESI.NET/Logic/SkillsLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class SkillsLogic + public class SkillsLogic : ISkillsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -37,7 +38,7 @@ public async Task> Attributes(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -53,7 +54,7 @@ public async Task> List(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); @@ -69,7 +70,7 @@ public async Task>> Queue(string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); } diff --git a/ESI.NET/Logic/SovereigntyLogic.cs b/ESI.NET/Logic/SovereigntyLogic.cs index 2829200..2f8ee85 100644 --- a/ESI.NET/Logic/SovereigntyLogic.cs +++ b/ESI.NET/Logic/SovereigntyLogic.cs @@ -3,11 +3,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class SovereigntyLogic + public class SovereigntyLogic : ISovereigntyLogic { private readonly HttpClient _client; private readonly EsiConfig _config; diff --git a/ESI.NET/Logic/StatusLogic.cs b/ESI.NET/Logic/StatusLogic.cs index fd04f45..324188f 100644 --- a/ESI.NET/Logic/StatusLogic.cs +++ b/ESI.NET/Logic/StatusLogic.cs @@ -2,11 +2,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class StatusLogic + public class StatusLogic : IStatusLogic { private readonly HttpClient _client; private readonly EsiConfig _config; diff --git a/ESI.NET/Logic/UniverseLogic.cs b/ESI.NET/Logic/UniverseLogic.cs index efd9822..1000d7c 100644 --- a/ESI.NET/Logic/UniverseLogic.cs +++ b/ESI.NET/Logic/UniverseLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class UniverseLogic + public class UniverseLogic : IUniverseLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -29,7 +30,7 @@ public async Task>> Bloodlines(string eTag = null, CancellationToken cancellationToken = default) => await Execute>(_client, _config, RequestSecurity.Public, HttpMethod.Get, "/universe/bloodlines/", - eTag: eTag, cancellationToken: cancellationToken ); + eTag: eTag, cancellationToken: cancellationToken); /// /// /universe/categories/ @@ -53,7 +54,7 @@ public async Task> Category(int category_id, string eTag = cancellationToken: cancellationToken, replacements: new Dictionary() { - { "category_id", category_id.ToString() } + {"category_id", category_id.ToString()} }); /// @@ -79,7 +80,7 @@ public async Task> Constellation(int constellation_id eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "constellation_id", constellation_id.ToString() } + {"constellation_id", constellation_id.ToString()} }); /// @@ -115,7 +116,7 @@ public async Task> Graphic(int graphic_id, string eTag = nu eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "graphic_id", graphic_id.ToString() } + {"graphic_id", graphic_id.ToString()} }); /// @@ -145,7 +146,7 @@ public async Task> Group(int group_id, string eTag = null, eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "group_id", group_id.ToString() } + {"group_id", group_id.ToString()} }); /// @@ -161,7 +162,7 @@ public async Task> Moon(int moon_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "moon_id", moon_id.ToString() } + {"moon_id", moon_id.ToString()} }); /// @@ -200,7 +201,7 @@ public async Task> Planet(int planet_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "planet_id", planet_id.ToString() } + {"planet_id", planet_id.ToString()} }); /// @@ -236,7 +237,7 @@ public async Task> Region(int region_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "region_id", region_id.ToString() } + {"region_id", region_id.ToString()} }); /// @@ -252,7 +253,7 @@ public async Task> Station(int station_id, string eTag = nu cancellationToken: cancellationToken, replacements: new Dictionary() { - { "station_id", station_id.ToString() } + {"station_id", station_id.ToString()} }); /// @@ -278,7 +279,7 @@ public async Task> Structure(long structure_id, string eT cancellationToken: cancellationToken, replacements: new Dictionary() { - { "structure_id", structure_id.ToString() } + {"structure_id", structure_id.ToString()} }, token: _data.Token); /// @@ -304,7 +305,7 @@ public async Task> System(int system_id, string eTag = cancellationToken: cancellationToken, replacements: new Dictionary() { - { "system_id", system_id.ToString() } + {"system_id", system_id.ToString()} }); /// @@ -335,7 +336,7 @@ public async Task> Type(int type_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "type_id", type_id.ToString() } + {"type_id", type_id.ToString()} }); /// @@ -351,7 +352,7 @@ public async Task> Stargate(int stargate_id, string eTag = cancellationToken: cancellationToken, replacements: new Dictionary() { - { "stargate_id", stargate_id.ToString() } + {"stargate_id", stargate_id.ToString()} }); /// @@ -387,7 +388,7 @@ public async Task> Star(int star_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "star_id", star_id.ToString() } + {"star_id", star_id.ToString()} }); /// @@ -414,7 +415,7 @@ public async Task>> AsteroidBelt(int asteroid_bel cancellationToken: cancellationToken, replacements: new Dictionary() { - { "asteroid_belt_id", asteroid_belt_id.ToString() } + {"asteroid_belt_id", asteroid_belt_id.ToString()} }); } } \ No newline at end of file diff --git a/ESI.NET/Logic/UserInterfaceLogic.cs b/ESI.NET/Logic/UserInterfaceLogic.cs index 2d6d4e5..a08c738 100644 --- a/ESI.NET/Logic/UserInterfaceLogic.cs +++ b/ESI.NET/Logic/UserInterfaceLogic.cs @@ -1,12 +1,13 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using ESI.NET.Models.SSO; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class UserInterfaceLogic + public class UserInterfaceLogic : IUserInterfaceLogic { private readonly HttpClient _client; private readonly EsiConfig _config; diff --git a/ESI.NET/Logic/WalletLogic.cs b/ESI.NET/Logic/WalletLogic.cs index 2c77423..32e6930 100644 --- a/ESI.NET/Logic/WalletLogic.cs +++ b/ESI.NET/Logic/WalletLogic.cs @@ -4,11 +4,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class WalletLogic + public class WalletLogic : IWalletLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -39,7 +40,7 @@ public async Task> CharacterWallet(string eTag = null, eTag: eTag, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, token: _data.Token); /// @@ -55,7 +56,7 @@ public async Task>> CharacterJournal(int page = 1 cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -77,7 +78,7 @@ public async Task>> CharacterTransactions(long fro cancellationToken: cancellationToken, replacements: new Dictionary() { - { "character_id", character_id.ToString() } + {"character_id", character_id.ToString()} }, parameters: new string[] { @@ -97,7 +98,7 @@ public async Task>> CorporationWallets(string eTag = nu cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() } + {"corporation_id", corporation_id.ToString()} }, token: _data.Token); @@ -116,8 +117,8 @@ public async Task>> CorporationJournal(int divisi cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() }, - { "division", division.ToString() } + {"corporation_id", corporation_id.ToString()}, + {"division", division.ToString()} }, parameters: new string[] { @@ -140,8 +141,8 @@ public async Task>> CorporationTransactions(int di cancellationToken: cancellationToken, replacements: new Dictionary() { - { "corporation_id", corporation_id.ToString() }, - { "division", division.ToString() } + {"corporation_id", corporation_id.ToString()}, + {"division", division.ToString()} }, parameters: new string[] { diff --git a/ESI.NET/Logic/WarsLogic.cs b/ESI.NET/Logic/WarsLogic.cs index 00fb765..c9155a8 100644 --- a/ESI.NET/Logic/WarsLogic.cs +++ b/ESI.NET/Logic/WarsLogic.cs @@ -3,11 +3,12 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; using static ESI.NET.EsiRequest; namespace ESI.NET.Logic { - public class WarsLogic + public class WarsLogic : IWarsLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -51,7 +52,7 @@ public async Task> Information(int war_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "war_id", war_id.ToString() } + {"war_id", war_id.ToString()} }); /// @@ -69,7 +70,7 @@ public async Task> Information(int war_id, string eTag = null, cancellationToken: cancellationToken, replacements: new Dictionary() { - { "war_id", war_id.ToString() } + {"war_id", war_id.ToString()} }, parameters: new string[] { diff --git a/ESI.NET/Logic/_SSOLogic.cs b/ESI.NET/Logic/_SSOLogic.cs index 9539b7f..6684580 100644 --- a/ESI.NET/Logic/_SSOLogic.cs +++ b/ESI.NET/Logic/_SSOLogic.cs @@ -14,10 +14,11 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using ESI.NET.Interfaces.Logic; namespace ESI.NET { - public class SsoLogic + public class SsoLogic : ISsoLogic { private readonly HttpClient _client; private readonly EsiConfig _config; @@ -94,7 +95,8 @@ public string GenerateChallengeCode() /// The authorization_code or the refresh_token /// Provide the same value that was provided for codeChallenge in CreateAuthenticationUrl(). All hashing/encryption will be done automatically. Just provide the code. /// - public async Task GetToken(GrantType grantType, string code, string codeChallenge = null, CancellationToken cancellationToken = default) + public async Task GetToken(GrantType grantType, string code, string codeChallenge = null, + CancellationToken cancellationToken = default) { var body = $"grant_type={grantType.ToEsiValue()}"; if (grantType == GrantType.AuthorizationCode) @@ -131,7 +133,7 @@ public async Task GetToken(GrantType grantType, string code, string co if (response.StatusCode != HttpStatusCode.OK) { - var error = JsonConvert.DeserializeAnonymousType(content, new { error_description = string.Empty }) + var error = JsonConvert.DeserializeAnonymousType(content, new {error_description = string.Empty}) .error_description; throw new ArgumentException(error); } @@ -160,7 +162,7 @@ public async Task RevokeToken(string code, CancellationToken cancellationToken = if (response.StatusCode != HttpStatusCode.OK) { - var error = JsonConvert.DeserializeAnonymousType(content, new { error_description = string.Empty }) + var error = JsonConvert.DeserializeAnonymousType(content, new {error_description = string.Empty}) .error_description; throw new ArgumentException(error); } @@ -222,7 +224,7 @@ public async Task Verify(SsoToken token, CancellationTo // Get more specifc details about authorized character to be used in API calls that require this data about the character var url = $"{_config.EsiUrl}latest/characters/affiliation/?datasource={_config.DataSource.ToEsiValue()}"; - var body = new StringContent(JsonConvert.SerializeObject(new int[] { authorizedCharacter.CharacterID }), + var body = new StringContent(JsonConvert.SerializeObject(new int[] {authorizedCharacter.CharacterID}), Encoding.UTF8, "application/json"); var client = new HttpClient(); diff --git a/ESI.NET/Models/Alliance/Alliance.cs b/ESI.NET/Models/Alliance/Alliance.cs index c3e31af..8e14ddb 100644 --- a/ESI.NET/Models/Alliance/Alliance.cs +++ b/ESI.NET/Models/Alliance/Alliance.cs @@ -8,23 +8,17 @@ public class Alliance [JsonProperty("creator_corporation_id")] public int CreatorCorporationId { get; set; } - [JsonProperty("creator_id")] - public int CreatorId { get; set; } + [JsonProperty("creator_id")] public int CreatorId { get; set; } - [JsonProperty("date_founded")] - public DateTime DateFounded { get; set; } + [JsonProperty("date_founded")] public DateTime DateFounded { get; set; } [JsonProperty("executor_corporation_id")] public int ExecutorCorporationId { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("ticker")] - public string Ticker { get; set; } + [JsonProperty("name")] public string Name { get; set; } + [JsonProperty("ticker")] public string Ticker { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Assets/Item.cs b/ESI.NET/Models/Assets/Item.cs index e2e27f7..123014d 100644 --- a/ESI.NET/Models/Assets/Item.cs +++ b/ESI.NET/Models/Assets/Item.cs @@ -4,28 +4,20 @@ namespace ESI.NET.Models.Assets { public class Item { - [JsonProperty("is_blueprint_copy")] - public bool IsBlueprintCopy { get; set; } + [JsonProperty("is_blueprint_copy")] public bool IsBlueprintCopy { get; set; } - [JsonProperty("is_singleton")] - public bool IsSingleton { get; set; } + [JsonProperty("is_singleton")] public bool IsSingleton { get; set; } - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("location_flag")] - public string LocationFlag { get; set; } + [JsonProperty("location_flag")] public string LocationFlag { get; set; } - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("location_type")] - public string LocationType { get; set; } + [JsonProperty("location_type")] public string LocationType { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Assets/ItemLocation.cs b/ESI.NET/Models/Assets/ItemLocation.cs index f9114b7..b037e48 100644 --- a/ESI.NET/Models/Assets/ItemLocation.cs +++ b/ESI.NET/Models/Assets/ItemLocation.cs @@ -4,16 +4,12 @@ namespace ESI.NET.Models.Assets { public class ItemLocation { - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("x")] - public double X { get; set; } + [JsonProperty("x")] public double X { get; set; } - [JsonProperty("y")] - public double Y { get; set; } + [JsonProperty("y")] public double Y { get; set; } - [JsonProperty("z")] - public double Z { get; set; } + [JsonProperty("z")] public double Z { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Assets/ItemName.cs b/ESI.NET/Models/Assets/ItemName.cs index e32c378..0b1ad5f 100644 --- a/ESI.NET/Models/Assets/ItemName.cs +++ b/ESI.NET/Models/Assets/ItemName.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.Assets { public class ItemName { - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Bookmarks/Bookmark.cs b/ESI.NET/Models/Bookmarks/Bookmark.cs index 79bf23b..07c6e7d 100644 --- a/ESI.NET/Models/Bookmarks/Bookmark.cs +++ b/ESI.NET/Models/Bookmarks/Bookmark.cs @@ -4,40 +4,29 @@ namespace ESI.NET.Models.Bookmarks { public class Bookmark { - [JsonProperty("bookmark_id")] - public int BookmarkId { get; set; } + [JsonProperty("bookmark_id")] public int BookmarkId { get; set; } - [JsonProperty("folder_id")] - public int FolderId { get; set; } + [JsonProperty("folder_id")] public int FolderId { get; set; } - [JsonProperty("created")] - public string Created { get; set; } + [JsonProperty("created")] public string Created { get; set; } - [JsonProperty("label")] - public string Label { get; set; } + [JsonProperty("label")] public string Label { get; set; } - [JsonProperty("notes")] - public string Notes { get; set; } + [JsonProperty("notes")] public string Notes { get; set; } - [JsonProperty("location_id")] - public int LocationId { get; set; } + [JsonProperty("location_id")] public int LocationId { get; set; } - [JsonProperty("creator_id")] - public int CreatorId { get; set; } + [JsonProperty("creator_id")] public int CreatorId { get; set; } - [JsonProperty("item")] - public Item Item { get; set; } + [JsonProperty("item")] public Item Item { get; set; } - [JsonProperty("coordinates")] - public Position Coordinates { get; set; } + [JsonProperty("coordinates")] public Position Coordinates { get; set; } } public class Item { - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Bookmarks/Folder.cs b/ESI.NET/Models/Bookmarks/Folder.cs index 6dedca8..8e05eda 100644 --- a/ESI.NET/Models/Bookmarks/Folder.cs +++ b/ESI.NET/Models/Bookmarks/Folder.cs @@ -4,11 +4,9 @@ namespace ESI.NET.Models.Bookmarks { public class Folder { - [JsonProperty("folder_id")] - public int FolderId { get; set; } + [JsonProperty("folder_id")] public int FolderId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } /// /// Not returned in /characters/{character_id}/bookmarks/ @@ -16,4 +14,4 @@ public class Folder [JsonProperty("creator_id")] public int CreatorId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Calendar/CalendarItem.cs b/ESI.NET/Models/Calendar/CalendarItem.cs index 2464f4a..fdaedb9 100644 --- a/ESI.NET/Models/Calendar/CalendarItem.cs +++ b/ESI.NET/Models/Calendar/CalendarItem.cs @@ -5,19 +5,14 @@ namespace ESI.NET.Models.Calendar { public class CalendarItem { - [JsonProperty("event_date")] - public DateTime EventDate { get; set; } + [JsonProperty("event_date")] public DateTime EventDate { get; set; } - [JsonProperty("event_id")] - public int EventId { get; set; } + [JsonProperty("event_id")] public int EventId { get; set; } - [JsonProperty("event_response")] - public string EventResponse { get; set; } + [JsonProperty("event_response")] public string EventResponse { get; set; } - [JsonProperty("importance")] - public int Importance { get; set; } + [JsonProperty("importance")] public int Importance { get; set; } - [JsonProperty("title")] - public string Title { get; set; } + [JsonProperty("title")] public string Title { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Calendar/Event.cs b/ESI.NET/Models/Calendar/Event.cs index a49cfc6..dea1504 100644 --- a/ESI.NET/Models/Calendar/Event.cs +++ b/ESI.NET/Models/Calendar/Event.cs @@ -5,34 +5,24 @@ namespace ESI.NET.Models.Calendar { public class Event { - [JsonProperty("date")] - public DateTime Date { get; set; } + [JsonProperty("date")] public DateTime Date { get; set; } - [JsonProperty("duration")] - public int Duration { get; set; } + [JsonProperty("duration")] public int Duration { get; set; } - [JsonProperty("event_id")] - public int EventId { get; set; } + [JsonProperty("event_id")] public int EventId { get; set; } - [JsonProperty("importance")] - public int Importance { get; set; } + [JsonProperty("importance")] public int Importance { get; set; } - [JsonProperty("owner_id")] - public int OwnerId { get; set; } + [JsonProperty("owner_id")] public int OwnerId { get; set; } - [JsonProperty("owner_name")] - public string OwnerName { get; set; } + [JsonProperty("owner_name")] public string OwnerName { get; set; } - [JsonProperty("owner_type")] - public string OwnerType { get; set; } + [JsonProperty("owner_type")] public string OwnerType { get; set; } - [JsonProperty("response")] - public string Response { get; set; } + [JsonProperty("response")] public string Response { get; set; } - [JsonProperty("text")] - public string Text { get; set; } + [JsonProperty("text")] public string Text { get; set; } - [JsonProperty("title")] - public string Title { get; set; } + [JsonProperty("title")] public string Title { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Calendar/Response.cs b/ESI.NET/Models/Calendar/Response.cs index 8e7e309..38f6533 100644 --- a/ESI.NET/Models/Calendar/Response.cs +++ b/ESI.NET/Models/Calendar/Response.cs @@ -5,10 +5,8 @@ namespace ESI.NET.Models.Calendar { public class Response { - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("event_response")] - public EventResponse EventResponse { get; set; } + [JsonProperty("event_response")] public EventResponse EventResponse { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Affiliation.cs b/ESI.NET/Models/Character/Affiliation.cs index 4915ccc..84b2e85 100644 --- a/ESI.NET/Models/Character/Affiliation.cs +++ b/ESI.NET/Models/Character/Affiliation.cs @@ -4,16 +4,12 @@ namespace ESI.NET.Models.Character { public class Affiliation { - [JsonProperty("alliance_id")] - public int AllianceId { get; set; } + [JsonProperty("alliance_id")] public int AllianceId { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Agent.cs b/ESI.NET/Models/Character/Agent.cs index f059997..aec5ce1 100644 --- a/ESI.NET/Models/Character/Agent.cs +++ b/ESI.NET/Models/Character/Agent.cs @@ -5,19 +5,14 @@ namespace ESI.NET.Models.Character { public class Agent { - [JsonProperty("agent_id")] - public int AgentId { get; set; } + [JsonProperty("agent_id")] public int AgentId { get; set; } - [JsonProperty("points_per_day")] - public float PointsPerDay { get; set; } + [JsonProperty("points_per_day")] public float PointsPerDay { get; set; } - [JsonProperty("remainder_points")] - public float RemainderPoints { get; set; } + [JsonProperty("remainder_points")] public float RemainderPoints { get; set; } - [JsonProperty("skill_type_id")] - public int SkillTypeId { get; set; } + [JsonProperty("skill_type_id")] public int SkillTypeId { get; set; } - [JsonProperty("started_at")] - public DateTime StartedAt { get; set; } + [JsonProperty("started_at")] public DateTime StartedAt { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Blueprint.cs b/ESI.NET/Models/Character/Blueprint.cs index 69a6355..ba7e334 100644 --- a/ESI.NET/Models/Character/Blueprint.cs +++ b/ESI.NET/Models/Character/Blueprint.cs @@ -4,28 +4,20 @@ namespace ESI.NET.Models.Character { public class Blueprint { - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("location_flag")] - public string LocationFlag { get; set; } + [JsonProperty("location_flag")] public string LocationFlag { get; set; } - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("material_efficiency")] - public int MaterialEfficiency { get; set; } + [JsonProperty("material_efficiency")] public int MaterialEfficiency { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } - [JsonProperty("runs")] - public int Runs { get; set; } + [JsonProperty("runs")] public int Runs { get; set; } - [JsonProperty("time_efficiency")] - public int TimeEfficiency { get; set; } + [JsonProperty("time_efficiency")] public int TimeEfficiency { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Character.cs b/ESI.NET/Models/Character/Character.cs index 766b968..8223acb 100644 --- a/ESI.NET/Models/Character/Character.cs +++ b/ESI.NET/Models/Character/Character.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.Character { public class Character { - [JsonProperty("character_id")] - public long Id { get; set; } + [JsonProperty("character_id")] public long Id { get; set; } - [JsonProperty("character_name")] - public string Name { get; set; } + [JsonProperty("character_name")] public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/CharacterInfo.cs b/ESI.NET/Models/Character/CharacterInfo.cs index fcf1bb0..82dc32d 100644 --- a/ESI.NET/Models/Character/CharacterInfo.cs +++ b/ESI.NET/Models/Character/CharacterInfo.cs @@ -4,13 +4,10 @@ namespace ESI.NET.Models.Character { public class CharacterInfo { - [JsonProperty("days_of_activity")] - public long DaysOfActivity { get; set; } + [JsonProperty("days_of_activity")] public long DaysOfActivity { get; set; } - [JsonProperty("minutes")] - public long Minutes { get; set; } + [JsonProperty("minutes")] public long Minutes { get; set; } - [JsonProperty("sessions_started")] - public long SessionsStarted { get; set; } + [JsonProperty("sessions_started")] public long SessionsStarted { get; set; } } } \ No newline at end of file diff --git a/ESI.NET/Models/Character/ChatChannel.cs b/ESI.NET/Models/Character/ChatChannel.cs index ee039cf..85b80db 100644 --- a/ESI.NET/Models/Character/ChatChannel.cs +++ b/ESI.NET/Models/Character/ChatChannel.cs @@ -6,53 +6,39 @@ namespace ESI.NET.Models.Character { public class ChatChannel { - [JsonProperty("allowed")] - public List Allowed { get; set; } = new List(); + [JsonProperty("allowed")] public List Allowed { get; set; } = new List(); - [JsonProperty("blocked")] - public List Blocked { get; set; } = new List(); + [JsonProperty("blocked")] public List Blocked { get; set; } = new List(); - [JsonProperty("channel_id")] - public long Id { get; set; } + [JsonProperty("channel_id")] public long Id { get; set; } - [JsonProperty("comparison_key")] - public string ComparisonKey { get; set; } + [JsonProperty("comparison_key")] public string ComparisonKey { get; set; } - [JsonProperty("has_password")] - public bool HasPassword { get; set; } + [JsonProperty("has_password")] public bool HasPassword { get; set; } - [JsonProperty("motd")] - public string MOTD { get; set; } + [JsonProperty("motd")] public string MOTD { get; set; } - [JsonProperty("muted")] - public List Muted { get; set; } = new List(); + [JsonProperty("muted")] public List Muted { get; set; } = new List(); - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("operators")] - public List Operators { get; set; } = new List(); + [JsonProperty("operators")] public List Operators { get; set; } = new List(); - [JsonProperty("owner_id")] - public long OwnerId { get; set; } + [JsonProperty("owner_id")] public long OwnerId { get; set; } } public class ChannelUser { - [JsonProperty("accessor_id")] - public long Id { get; set; } + [JsonProperty("accessor_id")] public long Id { get; set; } - [JsonProperty("accessor_type")] - public string AccessorType { get; set; } + [JsonProperty("accessor_type")] public string AccessorType { get; set; } } public class DeniedUser : ChannelUser { - [JsonProperty("end_at")] - public DateTime EndAt { get; set; } + [JsonProperty("end_at")] public DateTime EndAt { get; set; } - [JsonProperty("reason")] - public string Reason { get; set; } + [JsonProperty("reason")] public string Reason { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Combat.cs b/ESI.NET/Models/Character/Combat.cs index fb7936d..9d0b616 100644 --- a/ESI.NET/Models/Character/Combat.cs +++ b/ESI.NET/Models/Character/Combat.cs @@ -4,17 +4,13 @@ namespace ESI.NET.Models.Character { public class Combat { - [JsonProperty("cap_drainedby_npc")] - public long CapDrainedbyNpc { get; set; } + [JsonProperty("cap_drainedby_npc")] public long CapDrainedbyNpc { get; set; } - [JsonProperty("cap_drainedby_pc")] - public long CapDrainedbyPc { get; set; } + [JsonProperty("cap_drainedby_pc")] public long CapDrainedbyPc { get; set; } - [JsonProperty("cap_draining_pc")] - public long CapDrainingPc { get; set; } + [JsonProperty("cap_draining_pc")] public long CapDrainingPc { get; set; } - [JsonProperty("criminal_flag_set")] - public long CriminalFlagSet { get; set; } + [JsonProperty("criminal_flag_set")] public long CriminalFlagSet { get; set; } [JsonProperty("damage_from_np_cs_amount")] public long DamageFromNpCsAmount { get; set; } @@ -154,77 +150,53 @@ public class Combat [JsonProperty("damage_to_structures_total_num_shots")] public long DamageToStructuresTotalNumShots { get; set; } - [JsonProperty("deaths_high_sec")] - public long DeathsHighSec { get; set; } + [JsonProperty("deaths_high_sec")] public long DeathsHighSec { get; set; } - [JsonProperty("deaths_low_sec")] - public long DeathsLowSec { get; set; } + [JsonProperty("deaths_low_sec")] public long DeathsLowSec { get; set; } - [JsonProperty("deaths_null_sec")] - public long DeathsNullSec { get; set; } + [JsonProperty("deaths_null_sec")] public long DeathsNullSec { get; set; } - [JsonProperty("deaths_pod_high_sec")] - public long DeathsPodHighSec { get; set; } + [JsonProperty("deaths_pod_high_sec")] public long DeathsPodHighSec { get; set; } - [JsonProperty("deaths_pod_low_sec")] - public long DeathsPodLowSec { get; set; } + [JsonProperty("deaths_pod_low_sec")] public long DeathsPodLowSec { get; set; } - [JsonProperty("deaths_pod_null_sec")] - public long DeathsPodNullSec { get; set; } + [JsonProperty("deaths_pod_null_sec")] public long DeathsPodNullSec { get; set; } - [JsonProperty("deaths_pod_wormhole")] - public long DeathsPodWormhole { get; set; } + [JsonProperty("deaths_pod_wormhole")] public long DeathsPodWormhole { get; set; } - [JsonProperty("deaths_wormhole")] - public long DeathsWormhole { get; set; } + [JsonProperty("deaths_wormhole")] public long DeathsWormhole { get; set; } - [JsonProperty("drone_engage")] - public long DroneEngage { get; set; } + [JsonProperty("drone_engage")] public long DroneEngage { get; set; } - [JsonProperty("dscans")] - public long Dscans { get; set; } + [JsonProperty("dscans")] public long Dscans { get; set; } - [JsonProperty("duel_requested")] - public long DuelRequested { get; set; } + [JsonProperty("duel_requested")] public long DuelRequested { get; set; } - [JsonProperty("engagement_register")] - public long EngagementRegister { get; set; } + [JsonProperty("engagement_register")] public long EngagementRegister { get; set; } - [JsonProperty("kills_assists")] - public long KillsAssists { get; set; } + [JsonProperty("kills_assists")] public long KillsAssists { get; set; } - [JsonProperty("kills_high_sec")] - public long KillsHighSec { get; set; } + [JsonProperty("kills_high_sec")] public long KillsHighSec { get; set; } - [JsonProperty("kills_low_sec")] - public long KillsLowSec { get; set; } + [JsonProperty("kills_low_sec")] public long KillsLowSec { get; set; } - [JsonProperty("kills_null_sec")] - public long KillsNullSec { get; set; } + [JsonProperty("kills_null_sec")] public long KillsNullSec { get; set; } - [JsonProperty("kills_pod_high_sec")] - public long KillsPodHighSec { get; set; } + [JsonProperty("kills_pod_high_sec")] public long KillsPodHighSec { get; set; } - [JsonProperty("kills_pod_low_sec")] - public long KillsPodLowSec { get; set; } + [JsonProperty("kills_pod_low_sec")] public long KillsPodLowSec { get; set; } - [JsonProperty("kills_pod_null_sec")] - public long KillsPodNullSec { get; set; } + [JsonProperty("kills_pod_null_sec")] public long KillsPodNullSec { get; set; } - [JsonProperty("kills_pod_wormhole")] - public long KillsPodWormhole { get; set; } + [JsonProperty("kills_pod_wormhole")] public long KillsPodWormhole { get; set; } - [JsonProperty("kills_wormhole")] - public long KillsWormhole { get; set; } + [JsonProperty("kills_wormhole")] public long KillsWormhole { get; set; } - [JsonProperty("npc_flag_set")] - public long NpcFlagSet { get; set; } + [JsonProperty("npc_flag_set")] public long NpcFlagSet { get; set; } - [JsonProperty("probe_scans")] - public long ProbeScans { get; set; } + [JsonProperty("probe_scans")] public long ProbeScans { get; set; } - [JsonProperty("pvp_flag_set")] - public long PvpFlagSet { get; set; } + [JsonProperty("pvp_flag_set")] public long PvpFlagSet { get; set; } [JsonProperty("repair_armor_by_remote_amount")] public long RepairArmorByRemoteAmount { get; set; } @@ -262,28 +234,20 @@ public class Combat [JsonProperty("repair_shield_self_amount")] public long RepairShieldSelfAmount { get; set; } - [JsonProperty("self_destructs")] - public long SelfDestructs { get; set; } + [JsonProperty("self_destructs")] public long SelfDestructs { get; set; } - [JsonProperty("warp_scramble_pc")] - public long WarpScramblePc { get; set; } + [JsonProperty("warp_scramble_pc")] public long WarpScramblePc { get; set; } - [JsonProperty("warp_scrambledby_npc")] - public long WarpScrambledbyNpc { get; set; } + [JsonProperty("warp_scrambledby_npc")] public long WarpScrambledbyNpc { get; set; } - [JsonProperty("warp_scrambledby_pc")] - public long WarpScrambledbyPc { get; set; } + [JsonProperty("warp_scrambledby_pc")] public long WarpScrambledbyPc { get; set; } - [JsonProperty("weapon_flag_set")] - public long WeaponFlagSet { get; set; } + [JsonProperty("weapon_flag_set")] public long WeaponFlagSet { get; set; } - [JsonProperty("webifiedby_npc")] - public long WebifiedbyNpc { get; set; } + [JsonProperty("webifiedby_npc")] public long WebifiedbyNpc { get; set; } - [JsonProperty("webifiedby_pc")] - public long WebifiedbyPc { get; set; } + [JsonProperty("webifiedby_pc")] public long WebifiedbyPc { get; set; } - [JsonProperty("webifying_pc")] - public long WebifyingPc { get; set; } + [JsonProperty("webifying_pc")] public long WebifyingPc { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/ContactNotification.cs b/ESI.NET/Models/Character/ContactNotification.cs index a6c29f3..8539248 100644 --- a/ESI.NET/Models/Character/ContactNotification.cs +++ b/ESI.NET/Models/Character/ContactNotification.cs @@ -5,19 +5,14 @@ namespace ESI.NET.Models.Character { public class ContactNotification { - [JsonProperty("message")] - public string Message { get; set; } + [JsonProperty("message")] public string Message { get; set; } - [JsonProperty("notification_id")] - public long NotificationId { get; set; } + [JsonProperty("notification_id")] public long NotificationId { get; set; } - [JsonProperty("send_date")] - public DateTime SendDate { get; set; } + [JsonProperty("send_date")] public DateTime SendDate { get; set; } - [JsonProperty("sender_character_id")] - public long SenderCharacterId { get; set; } + [JsonProperty("sender_character_id")] public long SenderCharacterId { get; set; } - [JsonProperty("standing_level")] - public decimal StandingLevel { get; set; } + [JsonProperty("standing_level")] public decimal StandingLevel { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/CorporationHistory.cs b/ESI.NET/Models/Character/CorporationHistory.cs index 3c42512..cdde40c 100644 --- a/ESI.NET/Models/Character/CorporationHistory.cs +++ b/ESI.NET/Models/Character/CorporationHistory.cs @@ -5,16 +5,12 @@ namespace ESI.NET.Models.Character { public class CorporationHistory { - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("is_deleted")] - public bool IsDeleted { get; set; } + [JsonProperty("is_deleted")] public bool IsDeleted { get; set; } - [JsonProperty("record_id")] - public int RecordId { get; set; } + [JsonProperty("record_id")] public int RecordId { get; set; } - [JsonProperty("start_date")] - public DateTime StartDate { get; set; } + [JsonProperty("start_date")] public DateTime StartDate { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Fatigue.cs b/ESI.NET/Models/Character/Fatigue.cs index afa98fb..89f00b4 100644 --- a/ESI.NET/Models/Character/Fatigue.cs +++ b/ESI.NET/Models/Character/Fatigue.cs @@ -8,10 +8,8 @@ public class Fatigue [JsonProperty("jump_fatigue_expire_date")] public DateTime JumpFatigueExpireDate { get; set; } - [JsonProperty("last_jump_date")] - public DateTime LastJumpDate { get; set; } + [JsonProperty("last_jump_date")] public DateTime LastJumpDate { get; set; } - [JsonProperty("last_update_date")] - public DateTime LastUpdateDate { get; set; } + [JsonProperty("last_update_date")] public DateTime LastUpdateDate { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Industry.cs b/ESI.NET/Models/Character/Industry.cs index 104621e..c4cf924 100644 --- a/ESI.NET/Models/Character/Industry.cs +++ b/ESI.NET/Models/Character/Industry.cs @@ -4,11 +4,9 @@ namespace ESI.NET.Models.Character { public class Industry { - [JsonProperty("hacking_successes")] - public long HackingSuccesses { get; set; } + [JsonProperty("hacking_successes")] public long HackingSuccesses { get; set; } - [JsonProperty("jobs_cancelled")] - public long JobsCancelled { get; set; } + [JsonProperty("jobs_cancelled")] public long JobsCancelled { get; set; } [JsonProperty("jobs_completed_copy_blueprint")] public long JobsCompletedCopyBlueprint { get; set; } @@ -106,10 +104,9 @@ public class Industry [JsonProperty("jobs_started_time_productivity")] public long JobsStartedTimeProductivity { get; set; } - [JsonProperty("reprocess_item")] - public long ReprocessItem { get; set; } + [JsonProperty("reprocess_item")] public long ReprocessItem { get; set; } [JsonProperty("reprocess_item_quantity")] public long ReprocessItemQuantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Information.cs b/ESI.NET/Models/Character/Information.cs index 065fd25..74fb1c1 100644 --- a/ESI.NET/Models/Character/Information.cs +++ b/ESI.NET/Models/Character/Information.cs @@ -5,37 +5,26 @@ namespace ESI.NET.Models.Character { public class Information { - [JsonProperty("alliance_id")] - public long AllianceId { get; set; } + [JsonProperty("alliance_id")] public long AllianceId { get; set; } - [JsonProperty("ancestry_id")] - public long AncestryId { get; set; } + [JsonProperty("ancestry_id")] public long AncestryId { get; set; } - [JsonProperty("birthday")] - public DateTime Birthday { get; set; } + [JsonProperty("birthday")] public DateTime Birthday { get; set; } - [JsonProperty("bloodline_id")] - public long BloodlineId { get; set; } + [JsonProperty("bloodline_id")] public long BloodlineId { get; set; } - [JsonProperty("corporation_id")] - public long CorporationId { get; set; } + [JsonProperty("corporation_id")] public long CorporationId { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("faction_id")] - public long FactionId { get; set; } + [JsonProperty("faction_id")] public long FactionId { get; set; } - [JsonProperty("gender")] - public string Gender { get; set; } + [JsonProperty("gender")] public string Gender { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("race_id")] - public long RaceId { get; set; } + [JsonProperty("race_id")] public long RaceId { get; set; } - [JsonProperty("security_status")] - public decimal SecurityStatus { get; set; } + [JsonProperty("security_status")] public decimal SecurityStatus { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Inventory.cs b/ESI.NET/Models/Character/Inventory.cs index 58bdd4e..55d26dc 100644 --- a/ESI.NET/Models/Character/Inventory.cs +++ b/ESI.NET/Models/Character/Inventory.cs @@ -7,7 +7,6 @@ public class Inventory [JsonProperty("abandon_loot_quantity")] public long AbandonLootQuantity { get; set; } - [JsonProperty("trash_item_quantity")] - public long TrashItemQuantity { get; set; } + [JsonProperty("trash_item_quantity")] public long TrashItemQuantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Isk.cs b/ESI.NET/Models/Character/Isk.cs index d8cf4e0..6148900 100644 --- a/ESI.NET/Models/Character/Isk.cs +++ b/ESI.NET/Models/Character/Isk.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.Character { public class Isk { - [JsonProperty("in")] - public long In { get; set; } + [JsonProperty("in")] public long In { get; set; } - [JsonProperty("out")] - public long Out { get; set; } + [JsonProperty("out")] public long Out { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Market.cs b/ESI.NET/Models/Character/Market.cs index b5ee633..9c0055b 100644 --- a/ESI.NET/Models/Character/Market.cs +++ b/ESI.NET/Models/Character/Market.cs @@ -10,11 +10,9 @@ public class Market [JsonProperty("accept_contracts_item_exchange")] public long AcceptContractsItemExchange { get; set; } - [JsonProperty("buy_orders_placed")] - public long BuyOrdersPlaced { get; set; } + [JsonProperty("buy_orders_placed")] public long BuyOrdersPlaced { get; set; } - [JsonProperty("cancel_market_order")] - public long CancelMarketOrder { get; set; } + [JsonProperty("cancel_market_order")] public long CancelMarketOrder { get; set; } [JsonProperty("create_contracts_auction")] public long CreateContractsAuction { get; set; } @@ -28,19 +26,14 @@ public class Market [JsonProperty("deliver_courier_contract")] public long DeliverCourierContract { get; set; } - [JsonProperty("isk_gained")] - public long IskGained { get; set; } + [JsonProperty("isk_gained")] public long IskGained { get; set; } - [JsonProperty("isk_spent")] - public long IskSpent { get; set; } + [JsonProperty("isk_spent")] public long IskSpent { get; set; } - [JsonProperty("modify_market_order")] - public long ModifyMarketOrder { get; set; } + [JsonProperty("modify_market_order")] public long ModifyMarketOrder { get; set; } - [JsonProperty("search_contracts")] - public long SearchContracts { get; set; } + [JsonProperty("search_contracts")] public long SearchContracts { get; set; } - [JsonProperty("sell_orders_placed")] - public long SellOrdersPlaced { get; set; } + [JsonProperty("sell_orders_placed")] public long SellOrdersPlaced { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Medal.cs b/ESI.NET/Models/Character/Medal.cs index 01fdd56..22bf835 100644 --- a/ESI.NET/Models/Character/Medal.cs +++ b/ESI.NET/Models/Character/Medal.cs @@ -6,46 +6,33 @@ namespace ESI.NET.Models.Character { public class Medal { - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("date")] - public DateTime Date { get; set; } + [JsonProperty("date")] public DateTime Date { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("graphics")] - public List Graphics { get; set; } = new List(); + [JsonProperty("graphics")] public List Graphics { get; set; } = new List(); - [JsonProperty("issuer_id")] - public int IssuerId { get; set; } + [JsonProperty("issuer_id")] public int IssuerId { get; set; } - [JsonProperty("medal_id")] - public int MedalId { get; set; } + [JsonProperty("medal_id")] public int MedalId { get; set; } - [JsonProperty("reason")] - public string Reason { get; set; } + [JsonProperty("reason")] public string Reason { get; set; } - [JsonProperty("status")] - public string Status { get; set; } + [JsonProperty("status")] public string Status { get; set; } - [JsonProperty("title")] - public string Title { get; set; } + [JsonProperty("title")] public string Title { get; set; } } public class GraphicLayer { - [JsonProperty("color")] - public int Color { get; set; } + [JsonProperty("color")] public int Color { get; set; } - [JsonProperty("graphic")] - public string Graphic { get; set; } + [JsonProperty("graphic")] public string Graphic { get; set; } - [JsonProperty("layer")] - public int Layer { get; set; } + [JsonProperty("layer")] public int Layer { get; set; } - [JsonProperty("part")] - public int Part { get; set; } + [JsonProperty("part")] public int Part { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Mining.cs b/ESI.NET/Models/Character/Mining.cs index 9bdb796..0a184a6 100644 --- a/ESI.NET/Models/Character/Mining.cs +++ b/ESI.NET/Models/Character/Mining.cs @@ -4,61 +4,43 @@ namespace ESI.NET.Models.Character { public class Mining { - [JsonProperty("drone_mine")] - public long DroneMine { get; set; } + [JsonProperty("drone_mine")] public long DroneMine { get; set; } - [JsonProperty("ore_arkonor")] - public long OreArkonor { get; set; } + [JsonProperty("ore_arkonor")] public long OreArkonor { get; set; } - [JsonProperty("ore_bistot")] - public long OreBistot { get; set; } + [JsonProperty("ore_bistot")] public long OreBistot { get; set; } - [JsonProperty("ore_crokite")] - public long OreCrokite { get; set; } + [JsonProperty("ore_crokite")] public long OreCrokite { get; set; } - [JsonProperty("ore_dark_ochre")] - public long OreDarkOchre { get; set; } + [JsonProperty("ore_dark_ochre")] public long OreDarkOchre { get; set; } - [JsonProperty("ore_gneiss")] - public long OreGneiss { get; set; } + [JsonProperty("ore_gneiss")] public long OreGneiss { get; set; } [JsonProperty("ore_harvestable_cloud")] public long OreHarvestableCloud { get; set; } - [JsonProperty("ore_hedbergite")] - public long OreHedbergite { get; set; } + [JsonProperty("ore_hedbergite")] public long OreHedbergite { get; set; } - [JsonProperty("ore_hemorphite")] - public long OreHemorphite { get; set; } + [JsonProperty("ore_hemorphite")] public long OreHemorphite { get; set; } - [JsonProperty("ore_ice")] - public long OreIce { get; set; } + [JsonProperty("ore_ice")] public long OreIce { get; set; } - [JsonProperty("ore_jaspet")] - public long OreJaspet { get; set; } + [JsonProperty("ore_jaspet")] public long OreJaspet { get; set; } - [JsonProperty("ore_kernite")] - public long OreKernite { get; set; } + [JsonProperty("ore_kernite")] public long OreKernite { get; set; } - [JsonProperty("ore_mercoxit")] - public long OreMercoxit { get; set; } + [JsonProperty("ore_mercoxit")] public long OreMercoxit { get; set; } - [JsonProperty("ore_omber")] - public long OreOmber { get; set; } + [JsonProperty("ore_omber")] public long OreOmber { get; set; } - [JsonProperty("ore_plagioclase")] - public long OrePlagioclase { get; set; } + [JsonProperty("ore_plagioclase")] public long OrePlagioclase { get; set; } - [JsonProperty("ore_pyroxeres")] - public long OrePyroxeres { get; set; } + [JsonProperty("ore_pyroxeres")] public long OrePyroxeres { get; set; } - [JsonProperty("ore_scordite")] - public long OreScordite { get; set; } + [JsonProperty("ore_scordite")] public long OreScordite { get; set; } - [JsonProperty("ore_spodumain")] - public long OreSpodumain { get; set; } + [JsonProperty("ore_spodumain")] public long OreSpodumain { get; set; } - [JsonProperty("ore_veldspar")] - public long OreVeldspar { get; set; } + [JsonProperty("ore_veldspar")] public long OreVeldspar { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Module.cs b/ESI.NET/Models/Character/Module.cs index 5141fa8..0f271e7 100644 --- a/ESI.NET/Models/Character/Module.cs +++ b/ESI.NET/Models/Character/Module.cs @@ -16,8 +16,7 @@ public class Module [JsonProperty("activations_automated_targeting_system")] public long ActivationsAutomatedTargetingSystem { get; set; } - [JsonProperty("activations_bastion")] - public long ActivationsBastion { get; set; } + [JsonProperty("activations_bastion")] public long ActivationsBastion { get; set; } [JsonProperty("activations_bomb_launcher")] public long ActivationsBombLauncher { get; set; } @@ -49,11 +48,9 @@ public class Module [JsonProperty("activations_drone_tracking_modules")] public long ActivationsDroneTrackingModules { get; set; } - [JsonProperty("activations_eccm")] - public long ActivationsEccm { get; set; } + [JsonProperty("activations_eccm")] public long ActivationsEccm { get; set; } - [JsonProperty("activations_ecm")] - public long ActivationsEcm { get; set; } + [JsonProperty("activations_ecm")] public long ActivationsEcm { get; set; } [JsonProperty("activations_ecm_burst")] public long ActivationsEcmBurst { get; set; } @@ -145,8 +142,7 @@ public class Module [JsonProperty("activations_remote_tracking_computer")] public long ActivationsRemoteTrackingComputer { get; set; } - [JsonProperty("activations_salvager")] - public long ActivationsSalvager { get; set; } + [JsonProperty("activations_salvager")] public long ActivationsSalvager { get; set; } [JsonProperty("activations_sensor_booster")] public long ActivationsSensorBooster { get; set; } @@ -160,8 +156,7 @@ public class Module [JsonProperty("activations_ship_scanner")] public long ActivationsShipScanner { get; set; } - [JsonProperty("activations_siege")] - public long ActivationsSiege { get; set; } + [JsonProperty("activations_siege")] public long ActivationsSiege { get; set; } [JsonProperty("activations_smart_bomb")] public long ActivationsSmartBomb { get; set; } @@ -193,8 +188,7 @@ public class Module [JsonProperty("activations_tractor_beam")] public long ActivationsTractorBeam { get; set; } - [JsonProperty("activations_triage")] - public long ActivationsTriage { get; set; } + [JsonProperty("activations_triage")] public long ActivationsTriage { get; set; } [JsonProperty("activations_warp_disrupt_field_generator")] public long ActivationsWarpDisruptFieldGenerator { get; set; } @@ -202,13 +196,10 @@ public class Module [JsonProperty("activations_warp_scrambler")] public long ActivationsWarpScrambler { get; set; } - [JsonProperty("link_weapons")] - public long LinkWeapons { get; set; } + [JsonProperty("link_weapons")] public long LinkWeapons { get; set; } - [JsonProperty("overload")] - public long Overload { get; set; } + [JsonProperty("overload")] public long Overload { get; set; } - [JsonProperty("repairs")] - public long Repairs { get; set; } + [JsonProperty("repairs")] public long Repairs { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Notification.cs b/ESI.NET/Models/Character/Notification.cs index da97508..b9c86bf 100644 --- a/ESI.NET/Models/Character/Notification.cs +++ b/ESI.NET/Models/Character/Notification.cs @@ -5,25 +5,18 @@ namespace ESI.NET.Models.Character { public class Notification { - [JsonProperty("is_read")] - public bool IsRead { get; set; } + [JsonProperty("is_read")] public bool IsRead { get; set; } - [JsonProperty("notification_id")] - public long NotificationId { get; set; } + [JsonProperty("notification_id")] public long NotificationId { get; set; } - [JsonProperty("sender_id")] - public int SenderId { get; set; } + [JsonProperty("sender_id")] public int SenderId { get; set; } - [JsonProperty("sender_type")] - public string SenderType { get; set; } + [JsonProperty("sender_type")] public string SenderType { get; set; } - [JsonProperty("text")] - public string Text { get; set; } + [JsonProperty("text")] public string Text { get; set; } - [JsonProperty("timestamp")] - public DateTime Timestamp { get; set; } + [JsonProperty("timestamp")] public DateTime Timestamp { get; set; } - [JsonProperty("type")] - public string Type { get; set; } + [JsonProperty("type")] public string Type { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Orbital.cs b/ESI.NET/Models/Character/Orbital.cs index c58fae2..b7fa390 100644 --- a/ESI.NET/Models/Character/Orbital.cs +++ b/ESI.NET/Models/Character/Orbital.cs @@ -13,4 +13,4 @@ public class Orbital [JsonProperty("strike_damage_to_players_shield_amount")] public long StrikeDamageToPlayersShieldAmount { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Pve.cs b/ESI.NET/Models/Character/Pve.cs index 6b44fca..e51b5d5 100644 --- a/ESI.NET/Models/Character/Pve.cs +++ b/ESI.NET/Models/Character/Pve.cs @@ -10,10 +10,9 @@ public class Pve [JsonProperty("dungeons_completed_distribution")] public long DungeonsCompletedDistribution { get; set; } - [JsonProperty("missions_succeeded")] - public long MissionsSucceeded { get; set; } + [JsonProperty("missions_succeeded")] public long MissionsSucceeded { get; set; } [JsonProperty("missions_succeeded_epic_arc")] public long MissionsSucceededEpicArc { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Roles.cs b/ESI.NET/Models/Character/Roles.cs index ba35a37..22b1ead 100644 --- a/ESI.NET/Models/Character/Roles.cs +++ b/ESI.NET/Models/Character/Roles.cs @@ -4,17 +4,12 @@ namespace ESI.NET.Models.Character { public class Roles { - [JsonProperty("roles")] - public string[] MainRoles { get; set; } + [JsonProperty("roles")] public string[] MainRoles { get; set; } - [JsonProperty("roles_at_base")] - public string[] RolesAtBase { get; set; } + [JsonProperty("roles_at_base")] public string[] RolesAtBase { get; set; } - [JsonProperty("roles_at_hq")] - public string[] RolesAtHq { get; set; } - - [JsonProperty("roles_at_other")] - public string[] RolesAtOther { get; set; } + [JsonProperty("roles_at_hq")] public string[] RolesAtHq { get; set; } + [JsonProperty("roles_at_other")] public string[] RolesAtOther { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Social.cs b/ESI.NET/Models/Character/Social.cs index 1a92e64..701aa2e 100644 --- a/ESI.NET/Models/Character/Social.cs +++ b/ESI.NET/Models/Character/Social.cs @@ -4,26 +4,19 @@ namespace ESI.NET.Models.Character { public class Social { - [JsonProperty("add_contact_bad")] - public long AddContactBad { get; set; } + [JsonProperty("add_contact_bad")] public long AddContactBad { get; set; } - [JsonProperty("add_contact_good")] - public long AddContactGood { get; set; } + [JsonProperty("add_contact_good")] public long AddContactGood { get; set; } - [JsonProperty("add_contact_high")] - public long AddContactHigh { get; set; } + [JsonProperty("add_contact_high")] public long AddContactHigh { get; set; } - [JsonProperty("add_contact_horrible")] - public long AddContactHorrible { get; set; } + [JsonProperty("add_contact_horrible")] public long AddContactHorrible { get; set; } - [JsonProperty("add_contact_neutral")] - public long AddContactNeutral { get; set; } + [JsonProperty("add_contact_neutral")] public long AddContactNeutral { get; set; } - [JsonProperty("add_note")] - public long AddNote { get; set; } + [JsonProperty("add_note")] public long AddNote { get; set; } - [JsonProperty("added_as_contact_bad")] - public long AddedAsContactBad { get; set; } + [JsonProperty("added_as_contact_bad")] public long AddedAsContactBad { get; set; } [JsonProperty("added_as_contact_good")] public long AddedAsContactGood { get; set; } @@ -49,11 +42,9 @@ public class Social [JsonProperty("chat_messages_corporation")] public long ChatMessagesCorporation { get; set; } - [JsonProperty("chat_messages_fleet")] - public long ChatMessagesFleet { get; set; } + [JsonProperty("chat_messages_fleet")] public long ChatMessagesFleet { get; set; } - [JsonProperty("chat_messages_region")] - public long ChatMessagesRegion { get; set; } + [JsonProperty("chat_messages_region")] public long ChatMessagesRegion { get; set; } [JsonProperty("chat_messages_solarsystem")] public long ChatMessagesSolarsystem { get; set; } @@ -64,19 +55,14 @@ public class Social [JsonProperty("chat_total_message_length")] public long ChatTotalMessageLength { get; set; } - [JsonProperty("direct_trades")] - public long DirectTrades { get; set; } + [JsonProperty("direct_trades")] public long DirectTrades { get; set; } - [JsonProperty("fleet_broadcasts")] - public long FleetBroadcasts { get; set; } + [JsonProperty("fleet_broadcasts")] public long FleetBroadcasts { get; set; } - [JsonProperty("fleet_joins")] - public long FleetJoins { get; set; } + [JsonProperty("fleet_joins")] public long FleetJoins { get; set; } - [JsonProperty("mails_received")] - public long MailsReceived { get; set; } + [JsonProperty("mails_received")] public long MailsReceived { get; set; } - [JsonProperty("mails_sent")] - public long MailsSent { get; set; } + [JsonProperty("mails_sent")] public long MailsSent { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Title.cs b/ESI.NET/Models/Character/Title.cs index 6c8df74..96e0a4d 100644 --- a/ESI.NET/Models/Character/Title.cs +++ b/ESI.NET/Models/Character/Title.cs @@ -7,10 +7,8 @@ namespace ESI.NET.Models.Character { public class Title { - [JsonProperty("title_id")] - public long Id { get; set; } + [JsonProperty("title_id")] public long Id { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Character/Travel.cs b/ESI.NET/Models/Character/Travel.cs index 9a49e6c..c8637ce 100644 --- a/ESI.NET/Models/Character/Travel.cs +++ b/ESI.NET/Models/Character/Travel.cs @@ -7,8 +7,7 @@ public class Travel [JsonProperty("acceleration_gate_activations")] public long AccelerationGateActivations { get; set; } - [JsonProperty("align_to")] - public long AlignTo { get; set; } + [JsonProperty("align_to")] public long AlignTo { get; set; } [JsonProperty("distance_warped_high_sec")] public long DistanceWarpedHighSec { get; set; } @@ -22,14 +21,11 @@ public class Travel [JsonProperty("distance_warped_wormhole")] public long DistanceWarpedWormhole { get; set; } - [JsonProperty("docks_high_sec")] - public long DocksHighSec { get; set; } + [JsonProperty("docks_high_sec")] public long DocksHighSec { get; set; } - [JsonProperty("docks_low_sec")] - public long DocksLowSec { get; set; } + [JsonProperty("docks_low_sec")] public long DocksLowSec { get; set; } - [JsonProperty("docks_null_sec")] - public long DocksNullSec { get; set; } + [JsonProperty("docks_null_sec")] public long DocksNullSec { get; set; } [JsonProperty("jumps_stargate_high_sec")] public long JumpsStargateHighSec { get; set; } @@ -40,31 +36,23 @@ public class Travel [JsonProperty("jumps_stargate_null_sec")] public long JumpsStargateNullSec { get; set; } - [JsonProperty("jumps_wormhole")] - public long JumpsWormhole { get; set; } + [JsonProperty("jumps_wormhole")] public long JumpsWormhole { get; set; } - [JsonProperty("warps_high_sec")] - public long WarpsHighSec { get; set; } + [JsonProperty("warps_high_sec")] public long WarpsHighSec { get; set; } - [JsonProperty("warps_low_sec")] - public long WarpsLowSec { get; set; } + [JsonProperty("warps_low_sec")] public long WarpsLowSec { get; set; } - [JsonProperty("warps_null_sec")] - public long WarpsNullSec { get; set; } + [JsonProperty("warps_null_sec")] public long WarpsNullSec { get; set; } - [JsonProperty("warps_to_bookmark")] - public long WarpsToBookmark { get; set; } + [JsonProperty("warps_to_bookmark")] public long WarpsToBookmark { get; set; } - [JsonProperty("warps_to_celestial")] - public long WarpsToCelestial { get; set; } + [JsonProperty("warps_to_celestial")] public long WarpsToCelestial { get; set; } [JsonProperty("warps_to_fleet_member")] public long WarpsToFleetMember { get; set; } - [JsonProperty("warps_to_scan_result")] - public long WarpsToScanResult { get; set; } + [JsonProperty("warps_to_scan_result")] public long WarpsToScanResult { get; set; } - [JsonProperty("warps_wormhole")] - public long WarpsWormhole { get; set; } + [JsonProperty("warps_wormhole")] public long WarpsWormhole { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Clones/Clones.cs b/ESI.NET/Models/Clones/Clones.cs index 6f5a827..3128d3a 100644 --- a/ESI.NET/Models/Clones/Clones.cs +++ b/ESI.NET/Models/Clones/Clones.cs @@ -7,43 +7,33 @@ namespace ESI.NET.Models.Clones { public class Clones { - [JsonProperty("last_clone_jump_date")] - public DateTime LastCloneJumpDate { get; set; } + [JsonProperty("last_clone_jump_date")] public DateTime LastCloneJumpDate { get; set; } - [JsonProperty("home_location")] - public HomeLocation HomeLocation { get; set; } + [JsonProperty("home_location")] public HomeLocation HomeLocation { get; set; } [JsonProperty("last_station_change_date")] public DateTime LastStationChangeDate { get; set; } - [JsonProperty("jump_clones")] - public List JumpClones { get; set; } = new List(); + [JsonProperty("jump_clones")] public List JumpClones { get; set; } = new List(); } public class HomeLocation { - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("location_type")] - public string LocationType { get; set; } + [JsonProperty("location_type")] public string LocationType { get; set; } } public class JumpClone { - [JsonProperty("jump_clone_id")] - public int JumpCloneId { get; set; } + [JsonProperty("jump_clone_id")] public int JumpCloneId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("location_type")] - public string LocationType { get; set; } + [JsonProperty("location_type")] public string LocationType { get; set; } - [JsonProperty("implants")] - public int[] Implants { get; set; } + [JsonProperty("implants")] public int[] Implants { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Contacts/Contact.cs b/ESI.NET/Models/Contacts/Contact.cs index 5564415..01c1b6c 100644 --- a/ESI.NET/Models/Contacts/Contact.cs +++ b/ESI.NET/Models/Contacts/Contact.cs @@ -5,23 +5,16 @@ namespace ESI.NET.Models.Contacts { public class Contact { - [JsonProperty("standing")] - public decimal Standing { get; set; } + [JsonProperty("standing")] public decimal Standing { get; set; } - [JsonProperty("contact_type")] - public string ContactType { get; set; } + [JsonProperty("contact_type")] public string ContactType { get; set; } - [JsonProperty("contact_id")] - public int ContactId { get; set; } + [JsonProperty("contact_id")] public int ContactId { get; set; } - [JsonProperty("is_watched")] - public bool IsWatched { get; set; } + [JsonProperty("is_watched")] public bool IsWatched { get; set; } - [JsonProperty("is_blocked")] - public bool IsBlocked { get; set; } - - [JsonProperty("label_ids")] - public List LabelIds { get; set; } = new List(); + [JsonProperty("is_blocked")] public bool IsBlocked { get; set; } + [JsonProperty("label_ids")] public List LabelIds { get; set; } = new List(); } } \ No newline at end of file diff --git a/ESI.NET/Models/Contacts/Label.cs b/ESI.NET/Models/Contacts/Label.cs index e5ba358..a0f4e6d 100644 --- a/ESI.NET/Models/Contacts/Label.cs +++ b/ESI.NET/Models/Contacts/Label.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.Contacts { public class Label { - [JsonProperty("label_id")] - public long LabelId { get; set; } + [JsonProperty("label_id")] public long LabelId { get; set; } - [JsonProperty("label_name")] - public string LabelName { get; set; } + [JsonProperty("label_name")] public string LabelName { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Contracts/Bid.cs b/ESI.NET/Models/Contracts/Bid.cs index 9243a89..c2ea912 100644 --- a/ESI.NET/Models/Contracts/Bid.cs +++ b/ESI.NET/Models/Contracts/Bid.cs @@ -5,16 +5,12 @@ namespace ESI.NET.Models.Contracts { public class Bid { - [JsonProperty("bid_id")] - public int BidId { get; set; } + [JsonProperty("bid_id")] public int BidId { get; set; } - [JsonProperty("bidder_id")] - public int BidderId { get; set; } + [JsonProperty("bidder_id")] public int BidderId { get; set; } - [JsonProperty("date_bid")] - public DateTime DateBid { get; set; } + [JsonProperty("date_bid")] public DateTime DateBid { get; set; } - [JsonProperty("amount")] - public decimal Amount { get; set; } + [JsonProperty("amount")] public decimal Amount { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Contracts/Contract.cs b/ESI.NET/Models/Contracts/Contract.cs index 01e6824..6550062 100644 --- a/ESI.NET/Models/Contracts/Contract.cs +++ b/ESI.NET/Models/Contracts/Contract.cs @@ -6,70 +6,49 @@ namespace ESI.NET.Models.Contracts { public class Contract { - [JsonProperty("contract_id")] - public int ContractId { get; set; } + [JsonProperty("contract_id")] public int ContractId { get; set; } - [JsonProperty("issuer_id")] - public int IssuerId { get; set; } + [JsonProperty("issuer_id")] public int IssuerId { get; set; } [JsonProperty("issuer_corporation_id")] public int IssuerCorporationId { get; set; } - [JsonProperty("assignee_id")] - public int AssigneeId { get; set; } + [JsonProperty("assignee_id")] public int AssigneeId { get; set; } - [JsonProperty("acceptor_id")] - public int AcceptorId { get; set; } + [JsonProperty("acceptor_id")] public int AcceptorId { get; set; } - [JsonProperty("start_location_id")] - public long StartLocationId { get; set; } + [JsonProperty("start_location_id")] public long StartLocationId { get; set; } - [JsonProperty("end_location_id")] - public long EndLocationId { get; set; } + [JsonProperty("end_location_id")] public long EndLocationId { get; set; } - [JsonProperty("type")] - public ContractType Type { get; set; } + [JsonProperty("type")] public ContractType Type { get; set; } - [JsonProperty("status")] - public string Status { get; set; } + [JsonProperty("status")] public string Status { get; set; } - [JsonProperty("title")] - public string Title { get; set; } + [JsonProperty("title")] public string Title { get; set; } - [JsonProperty("for_corporation")] - public bool ForCorporation { get; set; } + [JsonProperty("for_corporation")] public bool ForCorporation { get; set; } - [JsonProperty("availability")] - public string Availability { get; set; } + [JsonProperty("availability")] public string Availability { get; set; } - [JsonProperty("date_issued")] - public DateTime DateIssued { get; set; } + [JsonProperty("date_issued")] public DateTime DateIssued { get; set; } - [JsonProperty("date_expired")] - public DateTime DateExpired { get; set; } + [JsonProperty("date_expired")] public DateTime DateExpired { get; set; } - [JsonProperty("date_accepted")] - public DateTime DateAccepted { get; set; } + [JsonProperty("date_accepted")] public DateTime DateAccepted { get; set; } - [JsonProperty("days_to_complete")] - public int DaysToComplete { get; set; } + [JsonProperty("days_to_complete")] public int DaysToComplete { get; set; } - [JsonProperty("date_completed")] - public DateTime DateCompleted { get; set; } + [JsonProperty("date_completed")] public DateTime DateCompleted { get; set; } - [JsonProperty("price")] - public decimal Price { get; set; } + [JsonProperty("price")] public decimal Price { get; set; } - [JsonProperty("reward")] - public decimal Reward { get; set; } + [JsonProperty("reward")] public decimal Reward { get; set; } - [JsonProperty("collateral")] - public decimal Collateral { get; set; } + [JsonProperty("collateral")] public decimal Collateral { get; set; } - [JsonProperty("buyout")] - public decimal Buyout { get; set; } + [JsonProperty("buyout")] public decimal Buyout { get; set; } - [JsonProperty("volume")] - public decimal Volume { get; set; } + [JsonProperty("volume")] public decimal Volume { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Contracts/ContractItem.cs b/ESI.NET/Models/Contracts/ContractItem.cs index 2586bd3..1b4143e 100644 --- a/ESI.NET/Models/Contracts/ContractItem.cs +++ b/ESI.NET/Models/Contracts/ContractItem.cs @@ -4,37 +4,26 @@ namespace ESI.NET.Models.Contracts { public class ContractItem { - [JsonProperty("record_id")] - public long RecordId { get; set; } + [JsonProperty("record_id")] public long RecordId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } - [JsonProperty("raw_quantity")] - public int RawQuantity { get; set; } + [JsonProperty("raw_quantity")] public int RawQuantity { get; set; } - [JsonProperty("is_singleton")] - public bool IsSingleton { get; set; } + [JsonProperty("is_singleton")] public bool IsSingleton { get; set; } - [JsonProperty("is_included")] - public bool IsIncluded { get; set; } + [JsonProperty("is_included")] public bool IsIncluded { get; set; } - [JsonProperty("is_blueprint_copy")] - public bool IsBlueprintCopy { get; set; } + [JsonProperty("is_blueprint_copy")] public bool IsBlueprintCopy { get; set; } - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("material_efficiency")] - public int MaterialEfficiency { get; set; } + [JsonProperty("material_efficiency")] public int MaterialEfficiency { get; set; } - [JsonProperty("runs")] - public int Runs { get; set; } + [JsonProperty("runs")] public int Runs { get; set; } - [JsonProperty("time_efficiency")] - public int TimeEfficiency { get; set; } + [JsonProperty("time_efficiency")] public int TimeEfficiency { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/AllianceHistory.cs b/ESI.NET/Models/Corporation/AllianceHistory.cs index f792ff1..36ef1fb 100644 --- a/ESI.NET/Models/Corporation/AllianceHistory.cs +++ b/ESI.NET/Models/Corporation/AllianceHistory.cs @@ -5,16 +5,12 @@ namespace ESI.NET.Models.Corporation { public class AllianceHistory { - [JsonProperty("alliance_id")] - public int AllianceId { get; set; } + [JsonProperty("alliance_id")] public int AllianceId { get; set; } - [JsonProperty("is_deleted")] - public bool IsDeleted { get; set; } + [JsonProperty("is_deleted")] public bool IsDeleted { get; set; } - [JsonProperty("record_id")] - public int RecordId { get; set; } + [JsonProperty("record_id")] public int RecordId { get; set; } - [JsonProperty("start_date")] - public DateTime StartDate { get; set; } + [JsonProperty("start_date")] public DateTime StartDate { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Blueprint.cs b/ESI.NET/Models/Corporation/Blueprint.cs index 56bcdb1..8aecf45 100644 --- a/ESI.NET/Models/Corporation/Blueprint.cs +++ b/ESI.NET/Models/Corporation/Blueprint.cs @@ -4,28 +4,20 @@ namespace ESI.NET.Models.Corporation { public class Blueprint { - [JsonProperty("item_id")] - public long ItemId { get; set; } + [JsonProperty("item_id")] public long ItemId { get; set; } - [JsonProperty("location_flag")] - public string LocationFlag { get; set; } + [JsonProperty("location_flag")] public string LocationFlag { get; set; } - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("material_efficiency")] - public int MaterialEfficiency { get; set; } + [JsonProperty("material_efficiency")] public int MaterialEfficiency { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } - [JsonProperty("runs")] - public int Runs { get; set; } + [JsonProperty("runs")] public int Runs { get; set; } - [JsonProperty("time_efficiency")] - public int TimeEfficiency { get; set; } + [JsonProperty("time_efficiency")] public int TimeEfficiency { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/CharacterRoles.cs b/ESI.NET/Models/Corporation/CharacterRoles.cs index 12f7914..7b03bee 100644 --- a/ESI.NET/Models/Corporation/CharacterRoles.cs +++ b/ESI.NET/Models/Corporation/CharacterRoles.cs @@ -4,11 +4,9 @@ namespace ESI.NET.Models.Corporation { public class CharacterRoles { - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("grantable_roles")] - public string[] GrantableRoles { get; set; } + [JsonProperty("grantable_roles")] public string[] GrantableRoles { get; set; } [JsonProperty("grantable_roles_at_base")] public string[] GrantableRolesAtBase { get; set; } @@ -19,16 +17,12 @@ public class CharacterRoles [JsonProperty("grantable_roles_at_other")] public string[] GrantableRolesAtOther { get; set; } - [JsonProperty("roles")] - public string[] Roles { get; set; } + [JsonProperty("roles")] public string[] Roles { get; set; } - [JsonProperty("roles_at_base")] - public string[] RolesAtBase { get; set; } + [JsonProperty("roles_at_base")] public string[] RolesAtBase { get; set; } - [JsonProperty("roles_at_hq")] - public string[] RolesAtHq { get; set; } + [JsonProperty("roles_at_hq")] public string[] RolesAtHq { get; set; } - [JsonProperty("roles_at_other")] - public string[] RolesAtOther { get; set; } + [JsonProperty("roles_at_other")] public string[] RolesAtOther { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/CharacterRolesHistory.cs b/ESI.NET/Models/Corporation/CharacterRolesHistory.cs index 9c3fef7..3723d53 100644 --- a/ESI.NET/Models/Corporation/CharacterRolesHistory.cs +++ b/ESI.NET/Models/Corporation/CharacterRolesHistory.cs @@ -5,22 +5,16 @@ namespace ESI.NET.Models.Corporation { public class CharacterRolesHistory { - [JsonProperty("changed_at")] - public DateTime ChangedAt { get; set; } + [JsonProperty("changed_at")] public DateTime ChangedAt { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("issuer_id")] - public int IssuerId { get; set; } + [JsonProperty("issuer_id")] public int IssuerId { get; set; } - [JsonProperty("new_roles")] - public string[] NewRoles { get; set; } + [JsonProperty("new_roles")] public string[] NewRoles { get; set; } - [JsonProperty("old_roles")] - public string[] OldRoles { get; set; } + [JsonProperty("old_roles")] public string[] OldRoles { get; set; } - [JsonProperty("role_type")] - public string RoleType { get; set; } + [JsonProperty("role_type")] public string RoleType { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/ContainerLog.cs b/ESI.NET/Models/Corporation/ContainerLog.cs index c4a0036..311bd6f 100644 --- a/ESI.NET/Models/Corporation/ContainerLog.cs +++ b/ESI.NET/Models/Corporation/ContainerLog.cs @@ -5,40 +5,28 @@ namespace ESI.NET.Models.Corporation { public class ContainerLog { - [JsonProperty("action")] - public string Action { get; set; } + [JsonProperty("action")] public string Action { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("container_id")] - public long ContainerId { get; set; } + [JsonProperty("container_id")] public long ContainerId { get; set; } - [JsonProperty("container_type_id")] - public int ContainerTypeId { get; set; } + [JsonProperty("container_type_id")] public int ContainerTypeId { get; set; } - [JsonProperty("location_flag")] - public string LocationFlag { get; set; } + [JsonProperty("location_flag")] public string LocationFlag { get; set; } - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("logged_at")] - public DateTime LoggedAt { get; set; } + [JsonProperty("logged_at")] public DateTime LoggedAt { get; set; } - [JsonProperty("new_config_bitmask")] - public int NewConfigBitmask { get; set; } + [JsonProperty("new_config_bitmask")] public int NewConfigBitmask { get; set; } - [JsonProperty("old_config_bitmask")] - public int OldConfigBitmask { get; set; } + [JsonProperty("old_config_bitmask")] public int OldConfigBitmask { get; set; } - [JsonProperty("password_type")] - public string PasswordType { get; set; } + [JsonProperty("password_type")] public string PasswordType { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Corporation.cs b/ESI.NET/Models/Corporation/Corporation.cs index 4892e75..9e7becb 100644 --- a/ESI.NET/Models/Corporation/Corporation.cs +++ b/ESI.NET/Models/Corporation/Corporation.cs @@ -5,46 +5,32 @@ namespace ESI.NET.Models.Corporation { public class Corporation { - [JsonProperty("alliance_id")] - public int AllianceId { get; set; } + [JsonProperty("alliance_id")] public int AllianceId { get; set; } - [JsonProperty("ceo_id")] - public int CeoId { get; set; } + [JsonProperty("ceo_id")] public int CeoId { get; set; } - [JsonProperty("creator_id")] - public int CreatorId { get; set; } + [JsonProperty("creator_id")] public int CreatorId { get; set; } - [JsonProperty("date_founded")] - public DateTime DateFounded { get; set; } + [JsonProperty("date_founded")] public DateTime DateFounded { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("home_station_id")] - public int HomeStationId { get; set; } + [JsonProperty("home_station_id")] public int HomeStationId { get; set; } - [JsonProperty("member_count")] - public int MemberCount { get; set; } + [JsonProperty("member_count")] public int MemberCount { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("shares")] - public long Shares { get; set; } + [JsonProperty("shares")] public long Shares { get; set; } - [JsonProperty("tax_rate")] - public decimal TaxRate { get; set; } + [JsonProperty("tax_rate")] public decimal TaxRate { get; set; } - [JsonProperty("ticker")] - public string Ticker { get; set; } + [JsonProperty("ticker")] public string Ticker { get; set; } - [JsonProperty("url")] - public string Url { get; set; } + [JsonProperty("url")] public string Url { get; set; } - [JsonProperty("war_eligible")] - public bool WarEligible { get; set; } + [JsonProperty("war_eligible")] public bool WarEligible { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Facility.cs b/ESI.NET/Models/Corporation/Facility.cs index 1491601..f890add 100644 --- a/ESI.NET/Models/Corporation/Facility.cs +++ b/ESI.NET/Models/Corporation/Facility.cs @@ -4,13 +4,10 @@ namespace ESI.NET.Models.Corporation { public class Facility { - [JsonProperty("facility_id")] - public long FacilityId { get; set; } + [JsonProperty("facility_id")] public long FacilityId { get; set; } - [JsonProperty("system_id")] - public int SystemId { get; set; } + [JsonProperty("system_id")] public int SystemId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/IssuedMedal.cs b/ESI.NET/Models/Corporation/IssuedMedal.cs index fb9cd58..1e042ae 100644 --- a/ESI.NET/Models/Corporation/IssuedMedal.cs +++ b/ESI.NET/Models/Corporation/IssuedMedal.cs @@ -5,22 +5,16 @@ namespace ESI.NET.Models.Corporation { public class IssuedMedal { - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("issued_at")] - public DateTime IssuedAt { get; set; } + [JsonProperty("issued_at")] public DateTime IssuedAt { get; set; } - [JsonProperty("issuer_id")] - public int IssuerId { get; set; } + [JsonProperty("issuer_id")] public int IssuerId { get; set; } - [JsonProperty("medal_id")] - public int MedalId { get; set; } + [JsonProperty("medal_id")] public int MedalId { get; set; } - [JsonProperty("reason")] - public string Reason { get; set; } + [JsonProperty("reason")] public string Reason { get; set; } - [JsonProperty("status")] - public string Status { get; set; } + [JsonProperty("status")] public string Status { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Medal.cs b/ESI.NET/Models/Corporation/Medal.cs index 31f85d1..f103600 100644 --- a/ESI.NET/Models/Corporation/Medal.cs +++ b/ESI.NET/Models/Corporation/Medal.cs @@ -5,19 +5,14 @@ namespace ESI.NET.Models.Corporation { public class Medal { - [JsonProperty("created_at")] - public DateTime CreatedAt { get; set; } + [JsonProperty("created_at")] public DateTime CreatedAt { get; set; } - [JsonProperty("creator_id")] - public int CreatorId { get; set; } + [JsonProperty("creator_id")] public int CreatorId { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("medal_id")] - public int MedalId { get; set; } + [JsonProperty("medal_id")] public int MedalId { get; set; } - [JsonProperty("title")] - public string Title { get; set; } + [JsonProperty("title")] public string Title { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/MemberInfo.cs b/ESI.NET/Models/Corporation/MemberInfo.cs index 22e0d06..b6d621d 100644 --- a/ESI.NET/Models/Corporation/MemberInfo.cs +++ b/ESI.NET/Models/Corporation/MemberInfo.cs @@ -5,25 +5,18 @@ namespace ESI.NET.Models.Corporation { public class MemberInfo { - [JsonProperty("base_id")] - public int BaseId { get; set; } + [JsonProperty("base_id")] public int BaseId { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("location_id")] - public long LocationId { get; set; } + [JsonProperty("location_id")] public long LocationId { get; set; } - [JsonProperty("logoff_date")] - public DateTime LogoffDate { get; set; } + [JsonProperty("logoff_date")] public DateTime LogoffDate { get; set; } - [JsonProperty("logon_date")] - public DateTime LogonDate { get; set; } + [JsonProperty("logon_date")] public DateTime LogonDate { get; set; } - [JsonProperty("ship_type_id")] - public int ShipTypeId { get; set; } + [JsonProperty("ship_type_id")] public int ShipTypeId { get; set; } - [JsonProperty("start_date")] - public DateTime StartDate { get; set; } + [JsonProperty("start_date")] public DateTime StartDate { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/MemberTitles.cs b/ESI.NET/Models/Corporation/MemberTitles.cs index 4950c0b..4ca3f12 100644 --- a/ESI.NET/Models/Corporation/MemberTitles.cs +++ b/ESI.NET/Models/Corporation/MemberTitles.cs @@ -4,11 +4,8 @@ namespace ESI.NET.Models.Corporation { public class MemberTitles { - [JsonProperty("character_id")] - public int CharacterId { get; set; } - - [JsonProperty("titles")] - public int[] Titles { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } + [JsonProperty("titles")] public int[] Titles { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Outpost.cs b/ESI.NET/Models/Corporation/Outpost.cs index aaa4fac..2f2f2be 100644 --- a/ESI.NET/Models/Corporation/Outpost.cs +++ b/ESI.NET/Models/Corporation/Outpost.cs @@ -7,20 +7,16 @@ namespace ESI.NET.Models.Corporation { public class Outpost { - [JsonProperty("owner_id")] - public int OwnerId { get; set; } + [JsonProperty("owner_id")] public int OwnerId { get; set; } - [JsonProperty("system_id")] - public int SystemId { get; set; } + [JsonProperty("system_id")] public int SystemId { get; set; } [JsonProperty("docking_cost_per_ship_volume")] public decimal DockingCostPerShipVolume { get; set; } - [JsonProperty("office_rental_cost")] - public long OfficeRentalCost { get; set; } + [JsonProperty("office_rental_cost")] public long OfficeRentalCost { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } [JsonProperty("reprocessing_efficiency")] public decimal ReprocessingEfficiency { get; set; } @@ -28,23 +24,18 @@ public class Outpost [JsonProperty("reprocessing_station_take")] public decimal ReprocessingStationTake { get; set; } - [JsonProperty("standing_owner_id")] - public int StandingOwnerId { get; set; } + [JsonProperty("standing_owner_id")] public int StandingOwnerId { get; set; } - [JsonProperty("coordinates")] - public Position Coordinates { get; set; } + [JsonProperty("coordinates")] public Position Coordinates { get; set; } - [JsonProperty("services")] - public List Services { get; set; } = new List(); + [JsonProperty("services")] public List Services { get; set; } = new List(); } public class OutpostService { - [JsonProperty("service_name")] - public string ServiceName { get; set; } + [JsonProperty("service_name")] public string ServiceName { get; set; } - [JsonProperty("minimum_standing")] - public decimal MinimumStanding { get; set; } + [JsonProperty("minimum_standing")] public decimal MinimumStanding { get; set; } [JsonProperty("surcharge_per_bad_standing")] public decimal SurchargePerBadStanding { get; set; } @@ -52,4 +43,4 @@ public class OutpostService [JsonProperty("discount_per_good_standing")] public decimal DiscountPerGoodStanding { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Shareholder.cs b/ESI.NET/Models/Corporation/Shareholder.cs index 93d86f9..5c0155f 100644 --- a/ESI.NET/Models/Corporation/Shareholder.cs +++ b/ESI.NET/Models/Corporation/Shareholder.cs @@ -4,13 +4,10 @@ namespace ESI.NET.Models.Corporation { public class Shareholder { - [JsonProperty("share_count")] - public long ShareCount { get; set; } + [JsonProperty("share_count")] public long ShareCount { get; set; } - [JsonProperty("shareholder_id")] - public int ShareholderId { get; set; } + [JsonProperty("shareholder_id")] public int ShareholderId { get; set; } - [JsonProperty("shareholder_type")] - public string ShareholderType { get; set; } + [JsonProperty("shareholder_type")] public string ShareholderType { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Starbase.cs b/ESI.NET/Models/Corporation/Starbase.cs index 48a5b09..f6935ea 100644 --- a/ESI.NET/Models/Corporation/Starbase.cs +++ b/ESI.NET/Models/Corporation/Starbase.cs @@ -5,28 +5,20 @@ namespace ESI.NET.Models.Corporation { public class Starbase { - [JsonProperty("moon_id")] - public int MoonId { get; set; } + [JsonProperty("moon_id")] public int MoonId { get; set; } - [JsonProperty("onlined_since")] - public DateTime OnlinedSince { get; set; } + [JsonProperty("onlined_since")] public DateTime OnlinedSince { get; set; } - [JsonProperty("reinforced_until")] - public DateTime ReinforcedUntil { get; set; } + [JsonProperty("reinforced_until")] public DateTime ReinforcedUntil { get; set; } - [JsonProperty("starbase_id")] - public long StarbaseId { get; set; } + [JsonProperty("starbase_id")] public long StarbaseId { get; set; } - [JsonProperty("state")] - public string State { get; set; } + [JsonProperty("state")] public string State { get; set; } - [JsonProperty("system_id")] - public int SystemId { get; set; } + [JsonProperty("system_id")] public int SystemId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("unanchor_at")] - public DateTime UnanchorAt { get; set; } + [JsonProperty("unanchor_at")] public DateTime UnanchorAt { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/StarbaseInfo.cs b/ESI.NET/Models/Corporation/StarbaseInfo.cs index ca2c298..6be1023 100644 --- a/ESI.NET/Models/Corporation/StarbaseInfo.cs +++ b/ESI.NET/Models/Corporation/StarbaseInfo.cs @@ -11,11 +11,9 @@ public class StarbaseInfo [JsonProperty("allow_corporation_members")] public bool AllowCorporationMembers { get; set; } - [JsonProperty("anchor")] - public string Anchor { get; set; } + [JsonProperty("anchor")] public string Anchor { get; set; } - [JsonProperty("attack_if_at_war")] - public bool AttackIfAtWar { get; set; } + [JsonProperty("attack_if_at_war")] public bool AttackIfAtWar { get; set; } [JsonProperty("attack_if_other_security_status_dropping")] public bool AttackIfOtherSecurityStatusDropping { get; set; } @@ -26,23 +24,17 @@ public class StarbaseInfo [JsonProperty("attack_standing_threshold")] public float AttackStandingThreshold { get; set; } - [JsonProperty("fuel_bay_take")] - public string FuelBayTake { get; set; } + [JsonProperty("fuel_bay_take")] public string FuelBayTake { get; set; } - [JsonProperty("fuel_bay_view")] - public string FuelBayView { get; set; } + [JsonProperty("fuel_bay_view")] public string FuelBayView { get; set; } - [JsonProperty("fuels")] - public List Fuels { get; set; } = new List(); + [JsonProperty("fuels")] public List Fuels { get; set; } = new List(); - [JsonProperty("offline")] - public string Offline { get; set; } + [JsonProperty("offline")] public string Offline { get; set; } - [JsonProperty("online")] - public string Online { get; set; } + [JsonProperty("online")] public string Online { get; set; } - [JsonProperty("unanchor")] - public string Unanchor { get; set; } + [JsonProperty("unanchor")] public string Unanchor { get; set; } [JsonProperty("use_alliance_standings")] public bool UseAllianceStandings { get; set; } @@ -50,10 +42,8 @@ public class StarbaseInfo public class Fuel { - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Structure.cs b/ESI.NET/Models/Corporation/Structure.cs index 03b5baf..844c46c 100644 --- a/ESI.NET/Models/Corporation/Structure.cs +++ b/ESI.NET/Models/Corporation/Structure.cs @@ -7,58 +7,41 @@ namespace ESI.NET.Models.Corporation { public class Structure { - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("fuel_expires")] - public DateTime FuelExpires { get; set; } + [JsonProperty("fuel_expires")] public DateTime FuelExpires { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("next_reinforce_apply")] - public DateTime NextReinforceApply { get; set; } + [JsonProperty("next_reinforce_apply")] public DateTime NextReinforceApply { get; set; } - [JsonProperty("next_reinforce_hour")] - public int NextReinforceHour { get; set; } + [JsonProperty("next_reinforce_hour")] public int NextReinforceHour { get; set; } - [JsonProperty("profile_id")] - public int ProfileId { get; set; } + [JsonProperty("profile_id")] public int ProfileId { get; set; } - [JsonProperty("reinforce_hour")] - public int ReinforceHour { get; set; } + [JsonProperty("reinforce_hour")] public int ReinforceHour { get; set; } - [JsonProperty("services")] - public List Services { get; set; } = new List(); + [JsonProperty("services")] public List Services { get; set; } = new List(); - [JsonProperty("state")] - public StructureState State { get; set; } + [JsonProperty("state")] public StructureState State { get; set; } - [JsonProperty("state_timer_end")] - public DateTime StateTimerEnd { get; set; } + [JsonProperty("state_timer_end")] public DateTime StateTimerEnd { get; set; } - [JsonProperty("state_timer_start")] - public DateTime StateTimerStart { get; set; } + [JsonProperty("state_timer_start")] public DateTime StateTimerStart { get; set; } - [JsonProperty("structure_id")] - public long StructureId { get; set; } + [JsonProperty("structure_id")] public long StructureId { get; set; } - [JsonProperty("system_id")] - public int SystemId { get; set; } + [JsonProperty("system_id")] public int SystemId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("unanchors_at")] - public DateTime UnanchorsAt { get; set; } + [JsonProperty("unanchors_at")] public DateTime UnanchorsAt { get; set; } } public class Service { - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("state")] - public StructureServiceState State { get; set; } + [JsonProperty("state")] public StructureServiceState State { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/Title.cs b/ESI.NET/Models/Corporation/Title.cs index df99eda..ffa979f 100644 --- a/ESI.NET/Models/Corporation/Title.cs +++ b/ESI.NET/Models/Corporation/Title.cs @@ -4,34 +4,27 @@ namespace ESI.NET.Models.Corporation { public class Title { - [JsonProperty("title_id")] - public int TitleId { get; set; } + [JsonProperty("title_id")] public int TitleId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("roles")] - public string[] Roles { get; set; } + [JsonProperty("roles")] public string[] Roles { get; set; } - [JsonProperty("grantable_roles")] - public string[] GrantableRoles { get; set; } + [JsonProperty("grantable_roles")] public string[] GrantableRoles { get; set; } - [JsonProperty("roles_at_hq")] - public string[] RolesAtHq { get; set; } + [JsonProperty("roles_at_hq")] public string[] RolesAtHq { get; set; } [JsonProperty("grantable_roles_at_hq")] public string[] GrantableRolesAtHq { get; set; } - [JsonProperty("roles_at_base")] - public string[] RolesAtBase { get; set; } + [JsonProperty("roles_at_base")] public string[] RolesAtBase { get; set; } [JsonProperty("grantable_roles_at_base")] public string[] GrantableRolesAtBase { get; set; } - [JsonProperty("roles_at_other")] - public string[] RolesAtOther { get; set; } + [JsonProperty("roles_at_other")] public string[] RolesAtOther { get; set; } [JsonProperty("grantable_roles_at_other")] public string[] GrantableRolesAtOther { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Corporation/WalletDivision.cs b/ESI.NET/Models/Corporation/WalletDivision.cs index 4f5c6f6..ba6d557 100644 --- a/ESI.NET/Models/Corporation/WalletDivision.cs +++ b/ESI.NET/Models/Corporation/WalletDivision.cs @@ -5,19 +5,15 @@ namespace ESI.NET.Models.Corporation { public class Divisions { - [JsonProperty("hangar")] - public List Hangar { get; set; } = new List(); + [JsonProperty("hangar")] public List Hangar { get; set; } = new List(); - [JsonProperty("wallet")] - public List Wallet { get; set; } = new List(); + [JsonProperty("wallet")] public List Wallet { get; set; } = new List(); } public class Division { - [JsonProperty("division")] - public int DivisionId { get; set; } + [JsonProperty("division")] public int DivisionId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Dogma/Attribute.cs b/ESI.NET/Models/Dogma/Attribute.cs index 0bd1c1e..5b88284 100644 --- a/ESI.NET/Models/Dogma/Attribute.cs +++ b/ESI.NET/Models/Dogma/Attribute.cs @@ -4,35 +4,25 @@ namespace ESI.NET.Models.Dogma { public class Attribute { - [JsonProperty("attribute_id")] - public int AttributeId { get; set; } + [JsonProperty("attribute_id")] public int AttributeId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("icon_id")] - public int IconId { get; set; } + [JsonProperty("icon_id")] public int IconId { get; set; } - [JsonProperty("default_value")] - public double DefaultValue { get; set; } + [JsonProperty("default_value")] public double DefaultValue { get; set; } - [JsonProperty("published")] - public bool Published { get; set; } + [JsonProperty("published")] public bool Published { get; set; } - [JsonProperty("display_name")] - public string DisplayName { get; set; } + [JsonProperty("display_name")] public string DisplayName { get; set; } - [JsonProperty("unit_id")] - public int UnitId { get; set; } + [JsonProperty("unit_id")] public int UnitId { get; set; } - [JsonProperty("stackable")] - public bool Stackable { get; set; } + [JsonProperty("stackable")] public bool Stackable { get; set; } - [JsonProperty("high_is_good")] - public bool HighIsGood { get; set; } + [JsonProperty("high_is_good")] public bool HighIsGood { get; set; } /// /// Only populated when used in DynamicItem; all other properties except AttributeId will be empty @@ -40,4 +30,4 @@ public class Attribute [JsonProperty("value")] public decimal Value { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Dogma/DynamicItem.cs b/ESI.NET/Models/Dogma/DynamicItem.cs index a800105..6a0e3a1 100644 --- a/ESI.NET/Models/Dogma/DynamicItem.cs +++ b/ESI.NET/Models/Dogma/DynamicItem.cs @@ -5,19 +5,14 @@ namespace ESI.NET.Models.Dogma { class DynamicItem { - [JsonProperty("created_by")] - public int CreatedBy { get; set; } + [JsonProperty("created_by")] public int CreatedBy { get; set; } - [JsonProperty("dogma_attributes")] - public List DogmaAttributes { get; set; } = new List(); + [JsonProperty("dogma_attributes")] public List DogmaAttributes { get; set; } = new List(); - [JsonProperty("dogma_effects")] - public List DogmaEffects { get; set; } = new List(); + [JsonProperty("dogma_effects")] public List DogmaEffects { get; set; } = new List(); - [JsonProperty("mutator_type_id")] - public int MutatorTypeId { get; set; } + [JsonProperty("mutator_type_id")] public int MutatorTypeId { get; set; } - [JsonProperty("source_type_id")] - public int SourceTypeId { get; set; } + [JsonProperty("source_type_id")] public int SourceTypeId { get; set; } } } \ No newline at end of file diff --git a/ESI.NET/Models/Dogma/Effect.cs b/ESI.NET/Models/Dogma/Effect.cs index b141c62..0b51572 100644 --- a/ESI.NET/Models/Dogma/Effect.cs +++ b/ESI.NET/Models/Dogma/Effect.cs @@ -5,50 +5,35 @@ namespace ESI.NET.Models.Dogma { public class Effect { - [JsonProperty("effect_id")] - public int EffectId { get; set; } + [JsonProperty("effect_id")] public int EffectId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("display_name")] - public string DisplayName { get; set; } + [JsonProperty("display_name")] public string DisplayName { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("icon_id")] - public int IconId { get; set; } + [JsonProperty("icon_id")] public int IconId { get; set; } - [JsonProperty("effect_category")] - public int EffectCategory { get; set; } + [JsonProperty("effect_category")] public int EffectCategory { get; set; } - [JsonProperty("pre_expression")] - public int PreExpression { get; set; } + [JsonProperty("pre_expression")] public int PreExpression { get; set; } - [JsonProperty("post_expression")] - public int PostExpression { get; set; } + [JsonProperty("post_expression")] public int PostExpression { get; set; } - [JsonProperty("is_offensive")] - public bool IsOffensive { get; set; } + [JsonProperty("is_offensive")] public bool IsOffensive { get; set; } - [JsonProperty("is_assistance")] - public bool IsAssistance { get; set; } + [JsonProperty("is_assistance")] public bool IsAssistance { get; set; } - [JsonProperty("disallow_auto_repeat")] - public bool DisallowAutoRepeat { get; set; } + [JsonProperty("disallow_auto_repeat")] public bool DisallowAutoRepeat { get; set; } - [JsonProperty("published")] - public bool Published { get; set; } + [JsonProperty("published")] public bool Published { get; set; } - [JsonProperty("is_warp_safe")] - public bool IsWarpSafe { get; set; } + [JsonProperty("is_warp_safe")] public bool IsWarpSafe { get; set; } - [JsonProperty("range_chance")] - public bool RangeChance { get; set; } + [JsonProperty("range_chance")] public bool RangeChance { get; set; } - [JsonProperty("electronic_chance")] - public bool ElectronicChance { get; set; } + [JsonProperty("electronic_chance")] public bool ElectronicChance { get; set; } [JsonProperty("duration_attribute_id")] public int DurationAttributeId { get; set; } @@ -59,14 +44,11 @@ public class Effect [JsonProperty("discharge_attribute_id")] public int DischargeAttributeId { get; set; } - [JsonProperty("range_attribute_id")] - public int RangeAttributeId { get; set; } + [JsonProperty("range_attribute_id")] public int RangeAttributeId { get; set; } - [JsonProperty("falloff_attribute_id")] - public int FalloffAttributeId { get; set; } + [JsonProperty("falloff_attribute_id")] public int FalloffAttributeId { get; set; } - [JsonProperty("modifiers")] - public List Modifiers { get; set; } = new List(); + [JsonProperty("modifiers")] public List Modifiers { get; set; } = new List(); /// /// Only populated when used in DynamicItem; all other properties except EffectId will be empty @@ -77,11 +59,9 @@ public class Effect public class Modifier { - [JsonProperty("func")] - public string Func { get; set; } + [JsonProperty("func")] public string Func { get; set; } - [JsonProperty("domain")] - public string Domain { get; set; } + [JsonProperty("domain")] public string Domain { get; set; } [JsonProperty("modified_attribute_id")] public int ModifiedAttributeId { get; set; } @@ -89,10 +69,8 @@ public class Modifier [JsonProperty("modifying_attribute_id")] public int ModifyingAttributeId { get; set; } - [JsonProperty("effect_id")] - public int EffectId { get; set; } + [JsonProperty("effect_id")] public int EffectId { get; set; } - [JsonProperty("operator")] - public int Operator { get; set; } + [JsonProperty("operator")] public int Operator { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/FactionWarfare/FactionWarfareSystem.cs b/ESI.NET/Models/FactionWarfare/FactionWarfareSystem.cs index 39e0a6e..c564615 100644 --- a/ESI.NET/Models/FactionWarfare/FactionWarfareSystem.cs +++ b/ESI.NET/Models/FactionWarfare/FactionWarfareSystem.cs @@ -5,22 +5,17 @@ namespace ESI.NET.Models.FactionWarfare { public class FactionWarfareSystem { - [JsonProperty("contested")] - public Contested Contested { get; set; } + [JsonProperty("contested")] public Contested Contested { get; set; } - [JsonProperty("occupier_faction_id")] - public int OccupierFactionId { get; set; } + [JsonProperty("occupier_faction_id")] public int OccupierFactionId { get; set; } - [JsonProperty("owner_faction_id")] - public int OwnerFactionId { get; set; } + [JsonProperty("owner_faction_id")] public int OwnerFactionId { get; set; } - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("victory_points")] - public int VictoryPoints { get; set; } + [JsonProperty("victory_points")] public int VictoryPoints { get; set; } [JsonProperty("victory_points_threshold")] public int VictoryPointsThreshold { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/FactionWarfare/Leaderboards.cs b/ESI.NET/Models/FactionWarfare/Leaderboards.cs index 26310ba..c2a2a01 100644 --- a/ESI.NET/Models/FactionWarfare/Leaderboards.cs +++ b/ESI.NET/Models/FactionWarfare/Leaderboards.cs @@ -5,49 +5,38 @@ namespace ESI.NET.Models.FactionWarfare { public class Leaderboards { - [JsonProperty("kills")] - public Summary Kills { get; set; } + [JsonProperty("kills")] public Summary Kills { get; set; } - [JsonProperty("victory_points")] - public Summary VictoryPoints { get; set; } + [JsonProperty("victory_points")] public Summary VictoryPoints { get; set; } } public class Summary { - [JsonProperty("yesterday")] - public List Yesterday { get; set; } = new List(); + [JsonProperty("yesterday")] public List Yesterday { get; set; } = new List(); - [JsonProperty("last_week")] - public List LastWeek { get; set; } = new List(); + [JsonProperty("last_week")] public List LastWeek { get; set; } = new List(); - [JsonProperty("active_total")] - public List ActiveTotal { get; set; } = new List(); + [JsonProperty("active_total")] public List ActiveTotal { get; set; } = new List(); } public class FactionTotal { - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("amount")] - public int Amount { get; set; } + [JsonProperty("amount")] public int Amount { get; set; } } public class CorporationTotal { - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("amount")] - public int Amount { get; set; } + [JsonProperty("amount")] public int Amount { get; set; } } public class CharacterTotal { - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("amount")] - public int Amount { get; set; } + [JsonProperty("amount")] public int Amount { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/FactionWarfare/Stat.cs b/ESI.NET/Models/FactionWarfare/Stat.cs index db37edb..a2ea003 100644 --- a/ESI.NET/Models/FactionWarfare/Stat.cs +++ b/ESI.NET/Models/FactionWarfare/Stat.cs @@ -5,34 +5,25 @@ namespace ESI.NET.Models.FactionWarfare { public class Stat { - [JsonProperty("current_rank")] - public int CurrentRank { get; set; } + [JsonProperty("current_rank")] public int CurrentRank { get; set; } - [JsonProperty("enlisted_on")] - public DateTime EnlistedOn { get; set; } + [JsonProperty("enlisted_on")] public DateTime EnlistedOn { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("highest_rank")] - public int HighestRank { get; set; } + [JsonProperty("highest_rank")] public int HighestRank { get; set; } - [JsonProperty("kills")] - public Totals Kills { get; set; } + [JsonProperty("kills")] public Totals Kills { get; set; } - [JsonProperty("victory_points")] - public Totals VictoryPoints { get; set; } + [JsonProperty("victory_points")] public Totals VictoryPoints { get; set; } } public class Totals { - [JsonProperty("last_week")] - public int LastWeek { get; set; } + [JsonProperty("last_week")] public int LastWeek { get; set; } - [JsonProperty("total")] - public int Total { get; set; } + [JsonProperty("total")] public int Total { get; set; } - [JsonProperty("yesterday")] - public int Yesterday { get; set; } + [JsonProperty("yesterday")] public int Yesterday { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/FactionWarfare/War.cs b/ESI.NET/Models/FactionWarfare/War.cs index 0a53254..45d4217 100644 --- a/ESI.NET/Models/FactionWarfare/War.cs +++ b/ESI.NET/Models/FactionWarfare/War.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.FactionWarfare { public class War { - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("against_id")] - public int AgainstId { get; set; } + [JsonProperty("against_id")] public int AgainstId { get; set; } } } \ No newline at end of file diff --git a/ESI.NET/Models/Fittings/Fitting.cs b/ESI.NET/Models/Fittings/Fitting.cs index 745f9af..d7e1b71 100644 --- a/ESI.NET/Models/Fittings/Fitting.cs +++ b/ESI.NET/Models/Fittings/Fitting.cs @@ -5,31 +5,23 @@ namespace ESI.NET.Models.Fittings { public class Fitting { - [JsonProperty("fitting_id")] - public int FittingId { get; set; } + [JsonProperty("fitting_id")] public int FittingId { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("description")] - public string Description { get; set; } + [JsonProperty("description")] public string Description { get; set; } - [JsonProperty("ship_type_id")] - public int ShipTypeId { get; set; } + [JsonProperty("ship_type_id")] public int ShipTypeId { get; set; } - [JsonProperty("items")] - public List Items { get; set; } = new List(); + [JsonProperty("items")] public List Items { get; set; } = new List(); } public class Item { - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("flag")] - public string Flag { get; set; } + [JsonProperty("flag")] public string Flag { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fittings/NewFitting.cs b/ESI.NET/Models/Fittings/NewFitting.cs index 17f61c2..ee85fd1 100644 --- a/ESI.NET/Models/Fittings/NewFitting.cs +++ b/ESI.NET/Models/Fittings/NewFitting.cs @@ -4,7 +4,6 @@ namespace ESI.NET.Models.Fittings { public class NewFitting { - [JsonProperty("fitting_id")] - public int FittingId { get; set; } + [JsonProperty("fitting_id")] public int FittingId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fleets/FleetInfo.cs b/ESI.NET/Models/Fleets/FleetInfo.cs index b030f61..06f1a16 100644 --- a/ESI.NET/Models/Fleets/FleetInfo.cs +++ b/ESI.NET/Models/Fleets/FleetInfo.cs @@ -4,16 +4,12 @@ namespace ESI.NET.Models.Fleets { public class FleetInfo { - [JsonProperty("fleet_id")] - public long FleetId { get; set; } + [JsonProperty("fleet_id")] public long FleetId { get; set; } - [JsonProperty("wing_id")] - public long WingId { get; set; } + [JsonProperty("wing_id")] public long WingId { get; set; } - [JsonProperty("squad_id")] - public long SquadId { get; set; } + [JsonProperty("squad_id")] public long SquadId { get; set; } - [JsonProperty("role")] - public string Role { get; set; } + [JsonProperty("role")] public string Role { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fleets/Member.cs b/ESI.NET/Models/Fleets/Member.cs index 24de963..4bd590e 100644 --- a/ESI.NET/Models/Fleets/Member.cs +++ b/ESI.NET/Models/Fleets/Member.cs @@ -5,34 +5,24 @@ namespace ESI.NET.Models.Fleets { public class Member { - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("ship_type_id")] - public int ShipTypeId { get; set; } + [JsonProperty("ship_type_id")] public int ShipTypeId { get; set; } - [JsonProperty("wing_id")] - public long WingId { get; set; } + [JsonProperty("wing_id")] public long WingId { get; set; } - [JsonProperty("squad_id")] - public long SquadId { get; set; } + [JsonProperty("squad_id")] public long SquadId { get; set; } - [JsonProperty("role")] - public string Role { get; set; } + [JsonProperty("role")] public string Role { get; set; } - [JsonProperty("role_name")] - public string RoleName { get; set; } + [JsonProperty("role_name")] public string RoleName { get; set; } - [JsonProperty("join_time")] - public DateTime JoinTime { get; set; } + [JsonProperty("join_time")] public DateTime JoinTime { get; set; } - [JsonProperty("takes_fleet_warp")] - public bool TakesFleetWarp { get; set; } + [JsonProperty("takes_fleet_warp")] public bool TakesFleetWarp { get; set; } - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("station_id")] - public long StationId { get; set; } + [JsonProperty("station_id")] public long StationId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fleets/NewSquad.cs b/ESI.NET/Models/Fleets/NewSquad.cs index fdd485f..ffda470 100644 --- a/ESI.NET/Models/Fleets/NewSquad.cs +++ b/ESI.NET/Models/Fleets/NewSquad.cs @@ -4,7 +4,6 @@ namespace ESI.NET.Models.Fleets { public class NewSquad { - [JsonProperty("squad_id")] - public long SquadId { get; set; } + [JsonProperty("squad_id")] public long SquadId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fleets/NewWing.cs b/ESI.NET/Models/Fleets/NewWing.cs index 27986c2..8b99c96 100644 --- a/ESI.NET/Models/Fleets/NewWing.cs +++ b/ESI.NET/Models/Fleets/NewWing.cs @@ -4,7 +4,6 @@ namespace ESI.NET.Models.Fleets { public class NewWing { - [JsonProperty("wing_id")] - public long WingId { get; set; } + [JsonProperty("wing_id")] public long WingId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fleets/Settings.cs b/ESI.NET/Models/Fleets/Settings.cs index d91c4e1..8e87d0d 100644 --- a/ESI.NET/Models/Fleets/Settings.cs +++ b/ESI.NET/Models/Fleets/Settings.cs @@ -4,16 +4,12 @@ namespace ESI.NET.Models.Fleets { public class Settings { - [JsonProperty("motd")] - public string Motd { get; set; } + [JsonProperty("motd")] public string Motd { get; set; } - [JsonProperty("is_free_move")] - public bool IsFreeMove { get; set; } + [JsonProperty("is_free_move")] public bool IsFreeMove { get; set; } - [JsonProperty("is_registered")] - public bool IsRegistered { get; set; } + [JsonProperty("is_registered")] public bool IsRegistered { get; set; } - [JsonProperty("is_voice_enabled")] - public bool IsVoiceEnabled { get; set; } + [JsonProperty("is_voice_enabled")] public bool IsVoiceEnabled { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Fleets/Wing.cs b/ESI.NET/Models/Fleets/Wing.cs index 7fbe2b6..12423b1 100644 --- a/ESI.NET/Models/Fleets/Wing.cs +++ b/ESI.NET/Models/Fleets/Wing.cs @@ -5,22 +5,17 @@ namespace ESI.NET.Models.Fleets { public class Wing { - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("id")] - public long Id { get; set; } + [JsonProperty("id")] public long Id { get; set; } - [JsonProperty("squads")] - public List Squads { get; set; } = new List(); + [JsonProperty("squads")] public List Squads { get; set; } = new List(); } public class Squad { - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("id")] - public long Id { get; set; } + [JsonProperty("id")] public long Id { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Images.cs b/ESI.NET/Models/Images.cs index f07d7eb..0d9edb8 100644 --- a/ESI.NET/Models/Images.cs +++ b/ESI.NET/Models/Images.cs @@ -1,19 +1,15 @@ using Newtonsoft.Json; - + namespace ESI.NET.Models { public class Images { - [JsonProperty("px512x512")] - public string x512 { get; set; } + [JsonProperty("px512x512")] public string x512 { get; set; } - [JsonProperty("px256x256")] - public string x256 { get; set; } + [JsonProperty("px256x256")] public string x256 { get; set; } - [JsonProperty("px128x128")] - public string x128 { get; set; } + [JsonProperty("px128x128")] public string x128 { get; set; } - [JsonProperty("px64x64")] - public string x64 { get; set; } + [JsonProperty("px64x64")] public string x64 { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Incursions/Incursion.cs b/ESI.NET/Models/Incursions/Incursion.cs index 29d0f97..c972088 100644 --- a/ESI.NET/Models/Incursions/Incursion.cs +++ b/ESI.NET/Models/Incursions/Incursion.cs @@ -4,28 +4,22 @@ namespace ESI.NET.Models.Incursions { public class Incursion { - [JsonProperty("constellation_id")] - public int ConstellationId { get; set; } + [JsonProperty("constellation_id")] public int ConstellationId { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("has_boss")] - public bool HasBoss { get; set; } + [JsonProperty("has_boss")] public bool HasBoss { get; set; } [JsonProperty("infested_solar_systems")] public long[] InfestedSystems { get; set; } - [JsonProperty("influence")] - public double Influence { get; set; } + [JsonProperty("influence")] public double Influence { get; set; } [JsonProperty("staging_solar_system_id")] public long StagingSystemId { get; set; } - [JsonProperty("state")] - public string State { get; set; } + [JsonProperty("state")] public string State { get; set; } - [JsonProperty("type")] - public string Type { get; set; } + [JsonProperty("type")] public string Type { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/Entry.cs b/ESI.NET/Models/Industry/Entry.cs index b1a51e1..b42dbba 100644 --- a/ESI.NET/Models/Industry/Entry.cs +++ b/ESI.NET/Models/Industry/Entry.cs @@ -7,16 +7,12 @@ namespace ESI.NET.Models.Industry { public class Entry { - [JsonProperty("date")] - public DateTime Date { get; set; } + [JsonProperty("date")] public DateTime Date { get; set; } - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("quantity")] - public long Quantity { get; set; } + [JsonProperty("quantity")] public long Quantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/Extraction.cs b/ESI.NET/Models/Industry/Extraction.cs index 9553a2c..f149f01 100644 --- a/ESI.NET/Models/Industry/Extraction.cs +++ b/ESI.NET/Models/Industry/Extraction.cs @@ -5,19 +5,15 @@ namespace ESI.NET.Models.Industry { public class Extraction { - [JsonProperty("structure_id")] - public long StructureId { get; set; } + [JsonProperty("structure_id")] public long StructureId { get; set; } - [JsonProperty("moon_id")] - public int MoonId { get; set; } + [JsonProperty("moon_id")] public int MoonId { get; set; } [JsonProperty("extraction_start_time")] public DateTime ExtractionStartTime { get; set; } - [JsonProperty("chunk_arrival_time")] - public DateTime ChunkArrivalTime { get; set; } + [JsonProperty("chunk_arrival_time")] public DateTime ChunkArrivalTime { get; set; } - [JsonProperty("natural_decay_time")] - public DateTime NaturalDecayTime { get; set; } + [JsonProperty("natural_decay_time")] public DateTime NaturalDecayTime { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/Facility.cs b/ESI.NET/Models/Industry/Facility.cs index 9cc19ee..6c0644b 100644 --- a/ESI.NET/Models/Industry/Facility.cs +++ b/ESI.NET/Models/Industry/Facility.cs @@ -4,22 +4,16 @@ namespace ESI.NET.Models.Industry { public class Facility { - [JsonProperty("facility_id")] - public long FacilityId { get; set; } + [JsonProperty("facility_id")] public long FacilityId { get; set; } - [JsonProperty("tax")] - public decimal Tax { get; set; } + [JsonProperty("tax")] public decimal Tax { get; set; } - [JsonProperty("owner_id")] - public int OwnerId { get; set; } + [JsonProperty("owner_id")] public int OwnerId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("region_id")] - public int RegionId { get; set; } + [JsonProperty("region_id")] public int RegionId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/Job.cs b/ESI.NET/Models/Industry/Job.cs index c3c9b7e..e976845 100644 --- a/ESI.NET/Models/Industry/Job.cs +++ b/ESI.NET/Models/Industry/Job.cs @@ -5,70 +5,50 @@ namespace ESI.NET.Models.Industry { public class Job { - [JsonProperty("job_id")] - public int JobId { get; set; } + [JsonProperty("job_id")] public int JobId { get; set; } - [JsonProperty("installer_id")] - public int InstallerId { get; set; } + [JsonProperty("installer_id")] public int InstallerId { get; set; } - [JsonProperty("facility_id")] - public long FacilityId { get; set; } + [JsonProperty("facility_id")] public long FacilityId { get; set; } - [JsonProperty("station_id")] - public long StationId { get; set; } + [JsonProperty("station_id")] public long StationId { get; set; } - [JsonProperty("activity_id")] - public int ActivityId { get; set; } + [JsonProperty("activity_id")] public int ActivityId { get; set; } - [JsonProperty("blueprint_id")] - public long BlueprintId { get; set; } + [JsonProperty("blueprint_id")] public long BlueprintId { get; set; } - [JsonProperty("blueprint_type_id")] - public int BlueprintTypeId { get; set; } + [JsonProperty("blueprint_type_id")] public int BlueprintTypeId { get; set; } [JsonProperty("blueprint_location_id")] public long BlueprintLocationId { get; set; } - [JsonProperty("output_location_id")] - public long OutputLocationId { get; set; } + [JsonProperty("output_location_id")] public long OutputLocationId { get; set; } - [JsonProperty("runs")] - public int Runs { get; set; } + [JsonProperty("runs")] public int Runs { get; set; } - [JsonProperty("cost")] - public decimal Cost { get; set; } + [JsonProperty("cost")] public decimal Cost { get; set; } - [JsonProperty("licensed_runs")] - public int LicensedRuns { get; set; } + [JsonProperty("licensed_runs")] public int LicensedRuns { get; set; } - [JsonProperty("probability")] - public decimal Probability { get; set; } + [JsonProperty("probability")] public decimal Probability { get; set; } - [JsonProperty("product_type_id")] - public int ProductTypeId { get; set; } + [JsonProperty("product_type_id")] public int ProductTypeId { get; set; } - [JsonProperty("status")] - public string Status { get; set; } + [JsonProperty("status")] public string Status { get; set; } - [JsonProperty("duration")] - public int Duration { get; set; } + [JsonProperty("duration")] public int Duration { get; set; } - [JsonProperty("start_date")] - public DateTime StartDate { get; set; } + [JsonProperty("start_date")] public DateTime StartDate { get; set; } - [JsonProperty("end_date")] - public DateTime EndDate { get; set; } + [JsonProperty("end_date")] public DateTime EndDate { get; set; } - [JsonProperty("pause_date")] - public DateTime PauseDate { get; set; } + [JsonProperty("pause_date")] public DateTime PauseDate { get; set; } - [JsonProperty("completed_date")] - public DateTime CompletedDate { get; set; } + [JsonProperty("completed_date")] public DateTime CompletedDate { get; set; } [JsonProperty("completed_character_id")] public int CompletedCharacterId { get; set; } - [JsonProperty("successful_runs")] - public int SuccessfulRuns { get; set; } + [JsonProperty("successful_runs")] public int SuccessfulRuns { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/Observer.cs b/ESI.NET/Models/Industry/Observer.cs index 786ae64..9d14686 100644 --- a/ESI.NET/Models/Industry/Observer.cs +++ b/ESI.NET/Models/Industry/Observer.cs @@ -5,13 +5,10 @@ namespace ESI.NET.Models.Industry { public class Observer { - [JsonProperty("last_updated")] - public DateTime LastUpdated { get; set; } + [JsonProperty("last_updated")] public DateTime LastUpdated { get; set; } - [JsonProperty("observer_id")] - public long ObserverId { get; set; } + [JsonProperty("observer_id")] public long ObserverId { get; set; } - [JsonProperty("observer_type")] - public string ObserverType { get; set; } + [JsonProperty("observer_type")] public string ObserverType { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/ObserverInfo.cs b/ESI.NET/Models/Industry/ObserverInfo.cs index 005751c..3aafc3d 100644 --- a/ESI.NET/Models/Industry/ObserverInfo.cs +++ b/ESI.NET/Models/Industry/ObserverInfo.cs @@ -5,19 +5,15 @@ namespace ESI.NET.Models.Industry { public class ObserverInfo { - [JsonProperty("last_updated")] - public DateTime LastUpdated { get; set; } + [JsonProperty("last_updated")] public DateTime LastUpdated { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } [JsonProperty("recorded_corporation_id")] public int RecordedCorporationId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("quantity")] - public long Quantity { get; set; } + [JsonProperty("quantity")] public long Quantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Industry/SolarSystem.cs b/ESI.NET/Models/Industry/SolarSystem.cs index a1da8f5..40b64b6 100644 --- a/ESI.NET/Models/Industry/SolarSystem.cs +++ b/ESI.NET/Models/Industry/SolarSystem.cs @@ -5,19 +5,15 @@ namespace ESI.NET.Models.Industry { public class SolarSystem { - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("cost_indices")] - public List CostIndices { get; set; } = new List(); + [JsonProperty("cost_indices")] public List CostIndices { get; set; } = new List(); } public class CostIndice { - [JsonProperty("activity")] - public string Activity { get; set; } + [JsonProperty("activity")] public string Activity { get; set; } - [JsonProperty("cost_index")] - public decimal CostIndex { get; set; } + [JsonProperty("cost_index")] public decimal CostIndex { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Insurance/Insurance.cs b/ESI.NET/Models/Insurance/Insurance.cs index cd242fc..b0c5ca7 100644 --- a/ESI.NET/Models/Insurance/Insurance.cs +++ b/ESI.NET/Models/Insurance/Insurance.cs @@ -5,22 +5,17 @@ namespace ESI.NET.Models.Insurance { public class Insurance { - [JsonProperty("type_id")] - public int TypeID { get; set; } + [JsonProperty("type_id")] public int TypeID { get; set; } - [JsonProperty("levels")] - public List Levels { get; set; } = new List(); + [JsonProperty("levels")] public List Levels { get; set; } = new List(); } public class Levels { - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("name")] public string Name { get; set; } - [JsonProperty("cost")] - public double Cost { get; set; } + [JsonProperty("cost")] public double Cost { get; set; } - [JsonProperty("payout")] - public double Payout { get; set; } + [JsonProperty("payout")] public double Payout { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Killmails/Information.cs b/ESI.NET/Models/Killmails/Information.cs index 80325f3..fab8ac8 100644 --- a/ESI.NET/Models/Killmails/Information.cs +++ b/ESI.NET/Models/Killmails/Information.cs @@ -6,103 +6,73 @@ namespace ESI.NET.Models.Killmails { public class Information { - [JsonProperty("attackers")] - public List Attackers { get; set; } = new List(); + [JsonProperty("attackers")] public List Attackers { get; set; } = new List(); - [JsonProperty("killmail_id")] - public long KillmailId { get; set; } + [JsonProperty("killmail_id")] public long KillmailId { get; set; } - [JsonProperty("killmail_time")] - public DateTime KillmailTime { get; set; } + [JsonProperty("killmail_time")] public DateTime KillmailTime { get; set; } - [JsonProperty("moon_id")] - public int MoonId { get; set; } + [JsonProperty("moon_id")] public int MoonId { get; set; } - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("victim")] - public Victim Victim { get; set; } + [JsonProperty("victim")] public Victim Victim { get; set; } - [JsonProperty("war_id")] - public int WarId { get; set; } + [JsonProperty("war_id")] public int WarId { get; set; } } public class Attacker { - [JsonProperty("alliance_id")] - public int AllianceId { get; set; } + [JsonProperty("alliance_id")] public int AllianceId { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("damage_done")] - public int DamageDone { get; set; } + [JsonProperty("damage_done")] public int DamageDone { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("final_blow")] - public bool FinalBlow { get; set; } + [JsonProperty("final_blow")] public bool FinalBlow { get; set; } - [JsonProperty("security_status")] - public double SecurityStatus { get; set; } + [JsonProperty("security_status")] public double SecurityStatus { get; set; } - [JsonProperty("ship_type_id")] - public int ShipTypeId { get; set; } + [JsonProperty("ship_type_id")] public int ShipTypeId { get; set; } - [JsonProperty("weapon_type_id")] - public int WeaponTypeId { get; set; } + [JsonProperty("weapon_type_id")] public int WeaponTypeId { get; set; } } public class Victim { - [JsonProperty("alliance_id")] - public int AllianceId { get; set; } + [JsonProperty("alliance_id")] public int AllianceId { get; set; } - [JsonProperty("character_id")] - public int CharacterId { get; set; } + [JsonProperty("character_id")] public int CharacterId { get; set; } - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("damage_taken")] - public int DamageTaken { get; set; } + [JsonProperty("damage_taken")] public int DamageTaken { get; set; } - [JsonProperty("faction_id")] - public int FactionId { get; set; } + [JsonProperty("faction_id")] public int FactionId { get; set; } - [JsonProperty("ship_type_id")] - public int ShipTypeId { get; set; } + [JsonProperty("ship_type_id")] public int ShipTypeId { get; set; } - [JsonProperty("items")] - public List Items { get; set; } = new List(); + [JsonProperty("items")] public List Items { get; set; } = new List(); - [JsonProperty("position")] - public Position Position { get; set; } + [JsonProperty("position")] public Position Position { get; set; } } public class Item { - [JsonProperty("flag")] - public int Flag { get; set; } + [JsonProperty("flag")] public int Flag { get; set; } - [JsonProperty("item_type_id")] - public int ItemTypeId { get; set; } + [JsonProperty("item_type_id")] public int ItemTypeId { get; set; } - [JsonProperty("items")] - public List Items { get; set; } + [JsonProperty("items")] public List Items { get; set; } - [JsonProperty("quantity_destroyed")] - public long QuantityDestroyed { get; set; } + [JsonProperty("quantity_destroyed")] public long QuantityDestroyed { get; set; } - [JsonProperty("quantity_dropped")] - public long QuantityDropped { get; set; } + [JsonProperty("quantity_dropped")] public long QuantityDropped { get; set; } - [JsonProperty("singleton")] - public int Singleton { get; set; } + [JsonProperty("singleton")] public int Singleton { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Killmails/Killmail.cs b/ESI.NET/Models/Killmails/Killmail.cs index c20f14b..a2bb0e1 100644 --- a/ESI.NET/Models/Killmails/Killmail.cs +++ b/ESI.NET/Models/Killmails/Killmail.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.Killmails { public class Killmail { - [JsonProperty("killmail_hash")] - public string Hash { get; set; } + [JsonProperty("killmail_hash")] public string Hash { get; set; } - [JsonProperty("killmail_id")] - public int Id { get; set; } + [JsonProperty("killmail_id")] public int Id { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Location/Activity.cs b/ESI.NET/Models/Location/Activity.cs index 8c05c3f..ce6e635 100644 --- a/ESI.NET/Models/Location/Activity.cs +++ b/ESI.NET/Models/Location/Activity.cs @@ -5,16 +5,12 @@ namespace ESI.NET.Models.Location { public class Activity { - [JsonProperty("online")] - public bool Online { get; set; } + [JsonProperty("online")] public bool Online { get; set; } - [JsonProperty("last_login")] - public DateTime LastLogin { get; set; } + [JsonProperty("last_login")] public DateTime LastLogin { get; set; } - [JsonProperty("last_logout")] - public DateTime LastLogout { get; set; } + [JsonProperty("last_logout")] public DateTime LastLogout { get; set; } - [JsonProperty("logins")] - public int Logins { get; set; } + [JsonProperty("logins")] public int Logins { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Location/Location.cs b/ESI.NET/Models/Location/Location.cs index 018ca01..8f5f2ad 100644 --- a/ESI.NET/Models/Location/Location.cs +++ b/ESI.NET/Models/Location/Location.cs @@ -4,13 +4,10 @@ namespace ESI.NET.Models.Location { public class Location { - [JsonProperty("solar_system_id")] - public int SolarSystemId { get; set; } + [JsonProperty("solar_system_id")] public int SolarSystemId { get; set; } - [JsonProperty("station_id")] - public int StationId { get; set; } + [JsonProperty("station_id")] public int StationId { get; set; } - [JsonProperty("structure_id")] - public long StructureId { get; set; } + [JsonProperty("structure_id")] public long StructureId { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Location/Ship.cs b/ESI.NET/Models/Location/Ship.cs index c307642..ff1331f 100644 --- a/ESI.NET/Models/Location/Ship.cs +++ b/ESI.NET/Models/Location/Ship.cs @@ -4,13 +4,10 @@ namespace ESI.NET.Models.Location { public class Ship { - [JsonProperty("ship_type_id")] - public int ShipTypeId { get; set; } + [JsonProperty("ship_type_id")] public int ShipTypeId { get; set; } - [JsonProperty("ship_item_id")] - public long ShipItemId { get; set; } + [JsonProperty("ship_item_id")] public long ShipItemId { get; set; } - [JsonProperty("ship_name")] - public string ShipName { get; set; } + [JsonProperty("ship_name")] public string ShipName { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Loyalty/Offer.cs b/ESI.NET/Models/Loyalty/Offer.cs index ace361f..04c139d 100644 --- a/ESI.NET/Models/Loyalty/Offer.cs +++ b/ESI.NET/Models/Loyalty/Offer.cs @@ -5,34 +5,25 @@ namespace ESI.NET.Models.Loyalty { public class Offer { - [JsonProperty("offer_id")] - public int OfferId { get; set; } + [JsonProperty("offer_id")] public int OfferId { get; set; } - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } - [JsonProperty("lp_cost")] - public int LpCost { get; set; } + [JsonProperty("lp_cost")] public int LpCost { get; set; } - [JsonProperty("isk_cost")] - public long IskCost { get; set; } + [JsonProperty("isk_cost")] public long IskCost { get; set; } - [JsonProperty("ak_cost")] - public int AkCost { get; set; } + [JsonProperty("ak_cost")] public int AkCost { get; set; } - [JsonProperty("required_items")] - public List RequiredItems { get; set; } = new List(); + [JsonProperty("required_items")] public List RequiredItems { get; set; } = new List(); } public class Item { - [JsonProperty("type_id")] - public int TypeId { get; set; } + [JsonProperty("type_id")] public int TypeId { get; set; } - [JsonProperty("quantity")] - public int Quantity { get; set; } + [JsonProperty("quantity")] public int Quantity { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Loyalty/Points.cs b/ESI.NET/Models/Loyalty/Points.cs index d24b34b..c8e4fcb 100644 --- a/ESI.NET/Models/Loyalty/Points.cs +++ b/ESI.NET/Models/Loyalty/Points.cs @@ -4,10 +4,8 @@ namespace ESI.NET.Models.Loyalty { public class Points { - [JsonProperty("corporation_id")] - public int CorporationId { get; set; } + [JsonProperty("corporation_id")] public int CorporationId { get; set; } - [JsonProperty("loyalty_points")] - public int LoyaltyPoints { get; set; } + [JsonProperty("loyalty_points")] public int LoyaltyPoints { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Mail/Header.cs b/ESI.NET/Models/Mail/Header.cs index aac0f5a..11892d7 100644 --- a/ESI.NET/Models/Mail/Header.cs +++ b/ESI.NET/Models/Mail/Header.cs @@ -5,25 +5,18 @@ namespace ESI.NET.Models.Mail { public class Header { - [JsonProperty("mail_id")] - public long MailId { get; set; } + [JsonProperty("mail_id")] public long MailId { get; set; } - [JsonProperty("subject")] - public string Subject { get; set; } + [JsonProperty("subject")] public string Subject { get; set; } - [JsonProperty("from")] - public int From { get; set; } + [JsonProperty("from")] public int From { get; set; } - [JsonProperty("timestamp")] - public string Timestamp { get; set; } + [JsonProperty("timestamp")] public string Timestamp { get; set; } - [JsonProperty("labels")] - public long[] Labels { get; set; } + [JsonProperty("labels")] public long[] Labels { get; set; } - [JsonProperty("recipients")] - public List Recipients { get; set; } = new List(); + [JsonProperty("recipients")] public List Recipients { get; set; } = new List(); - [JsonProperty("is_read")] - public bool IsRead { get; set; } + [JsonProperty("is_read")] public bool IsRead { get; set; } } -} +} \ No newline at end of file diff --git a/ESI.NET/Models/Mail/LabelCounts.cs b/ESI.NET/Models/Mail/LabelCounts.cs index 8165916..d278dc9 100644 --- a/ESI.NET/Models/Mail/LabelCounts.cs +++ b/ESI.NET/Models/Mail/LabelCounts.cs @@ -5,25 +5,19 @@ namespace ESI.NET.Models.Mail { public class LabelCounts { - [JsonProperty("total_unread_count")] - public int TotalUnreadCount { get; set; } + [JsonProperty("total_unread_count")] public int TotalUnreadCount { get; set; } - [JsonProperty("labels")] - public List