From 24ff96ab841d77b8afa8447d9fbd0e7e7fa0a518 Mon Sep 17 00:00:00 2001 From: Asesjix Date: Mon, 13 Aug 2018 23:39:48 +0200 Subject: [PATCH 1/3] Update dependencies --- global.json | 5 ----- samples/Zammad.Connector/Zammad.Connector.csproj | 12 ++++++------ .../Zammad.Client.IntegrationTests.csproj | 8 ++++---- .../Core/Protocol/BasicHttpClientHandlerTest.cs | 2 +- .../Core/Protocol/TokenHttpClientHandlerTest.cs | 2 +- test/Zammad.Client.Tests/Zammad.Client.Tests.csproj | 10 +++++----- 6 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 global.json diff --git a/global.json b/global.json deleted file mode 100644 index 057fc0c..0000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "2.1.200" - } -} \ No newline at end of file diff --git a/samples/Zammad.Connector/Zammad.Connector.csproj b/samples/Zammad.Connector/Zammad.Connector.csproj index 932dec2..ce40e9c 100644 --- a/samples/Zammad.Connector/Zammad.Connector.csproj +++ b/samples/Zammad.Connector/Zammad.Connector.csproj @@ -12,7 +12,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 7.1 @@ -23,11 +23,11 @@ - - - - - + + + + + diff --git a/test/Zammad.Client.IntegrationTests/Zammad.Client.IntegrationTests.csproj b/test/Zammad.Client.IntegrationTests/Zammad.Client.IntegrationTests.csproj index 3b81d7e..5cb1ae3 100644 --- a/test/Zammad.Client.IntegrationTests/Zammad.Client.IntegrationTests.csproj +++ b/test/Zammad.Client.IntegrationTests/Zammad.Client.IntegrationTests.csproj @@ -15,15 +15,15 @@ - netcoreapp2.0 + netcoreapp2.1 false Zammad.Client.IntegrationTests - - - + + + diff --git a/test/Zammad.Client.Tests/Core/Protocol/BasicHttpClientHandlerTest.cs b/test/Zammad.Client.Tests/Core/Protocol/BasicHttpClientHandlerTest.cs index 9066b9d..80e2748 100644 --- a/test/Zammad.Client.Tests/Core/Protocol/BasicHttpClientHandlerTest.cs +++ b/test/Zammad.Client.Tests/Core/Protocol/BasicHttpClientHandlerTest.cs @@ -15,7 +15,7 @@ public async Task BasicHttpClientHandler_Success_Test(string user, string passwo using (var httpHandler = new BasicHttpClientHandler(user, password, null)) using (var httpClient = new HttpClient(httpHandler)) { - var response = await httpClient.GetAsync("http://zammad.com"); + var response = await httpClient.GetAsync("https://zammad.com"); Assert.Equal("Basic", response.RequestMessage.Headers.Authorization.Scheme); Assert.Equal(expected, response.RequestMessage.Headers.Authorization.Parameter); } diff --git a/test/Zammad.Client.Tests/Core/Protocol/TokenHttpClientHandlerTest.cs b/test/Zammad.Client.Tests/Core/Protocol/TokenHttpClientHandlerTest.cs index c4550b7..2713115 100644 --- a/test/Zammad.Client.Tests/Core/Protocol/TokenHttpClientHandlerTest.cs +++ b/test/Zammad.Client.Tests/Core/Protocol/TokenHttpClientHandlerTest.cs @@ -15,7 +15,7 @@ public async Task TokenHttpClientHandler_Success_Test(string token, string expec using (var httpHandler = new TokenHttpClientHandler(token, null)) using (var httpClient = new HttpClient(httpHandler)) { - var response = await httpClient.GetAsync("http://zammad.com"); + var response = await httpClient.GetAsync("https://zammad.com"); Assert.Equal("Token", response.RequestMessage.Headers.Authorization.Scheme); Assert.Equal(expected, response.RequestMessage.Headers.Authorization.Parameter); } diff --git a/test/Zammad.Client.Tests/Zammad.Client.Tests.csproj b/test/Zammad.Client.Tests/Zammad.Client.Tests.csproj index 79e3983..8758f1b 100644 --- a/test/Zammad.Client.Tests/Zammad.Client.Tests.csproj +++ b/test/Zammad.Client.Tests/Zammad.Client.Tests.csproj @@ -15,15 +15,15 @@ - netcoreapp2.0 + netcoreapp2.1 false - - - - + + + + From ea483a496905a81ae75fd15c87be717da46814fb Mon Sep 17 00:00:00 2001 From: Asesjix Date: Mon, 13 Aug 2018 23:58:24 +0200 Subject: [PATCH 2/3] Remove questions mark #15 --- src/Zammad.Client/GroupClient.cs | 2 +- src/Zammad.Client/OnlineNotificationClient.cs | 2 +- src/Zammad.Client/OrganizationClient.cs | 4 ++-- src/Zammad.Client/TagClient.cs | 8 ++++---- src/Zammad.Client/TicketClient.cs | 10 +++++----- src/Zammad.Client/UserClient.cs | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Zammad.Client/GroupClient.cs b/src/Zammad.Client/GroupClient.cs index d3e50c4..7449c4c 100644 --- a/src/Zammad.Client/GroupClient.cs +++ b/src/Zammad.Client/GroupClient.cs @@ -23,7 +23,7 @@ public Task> GetGroupListAsync() public Task> GetGroupListAsync(int page, int count) { - return GetAsync>("/api/v1/groups", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/groups", $"page={page},per_page={count}"); } public Task GetGroupAsync(int id) diff --git a/src/Zammad.Client/OnlineNotificationClient.cs b/src/Zammad.Client/OnlineNotificationClient.cs index 0e94b67..888ddcf 100644 --- a/src/Zammad.Client/OnlineNotificationClient.cs +++ b/src/Zammad.Client/OnlineNotificationClient.cs @@ -23,7 +23,7 @@ public Task> GetOnlineNotificationListAsync() public Task> GetOnlineNotificationListAsync(int page, int count) { - return GetAsync>("/api/v1/online_notifications", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/online_notifications", $"page={page},per_page={count}"); } public Task GetOnlineNotificationAsync(int id) diff --git a/src/Zammad.Client/OrganizationClient.cs b/src/Zammad.Client/OrganizationClient.cs index 9f5d8f0..49cf5bb 100644 --- a/src/Zammad.Client/OrganizationClient.cs +++ b/src/Zammad.Client/OrganizationClient.cs @@ -23,12 +23,12 @@ public Task> GetOrganizationListAsync() public Task> GetOrganizationListAsync(int page, int count) { - return GetAsync>("/api/v1/organizations", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/organizations", $"page={page},per_page={count}"); } public Task> SearchOrganizationAsync(string query, int limit) { - return GetAsync>("/api/v1/organizations/search", $"?query={query}&limit={limit}&expand=true"); + return GetAsync>("/api/v1/organizations/search", $"query={query}&limit={limit}&expand=true"); } public Task GetOrganizationAsync(int id) diff --git a/src/Zammad.Client/TagClient.cs b/src/Zammad.Client/TagClient.cs index 678723c..46d0cc3 100644 --- a/src/Zammad.Client/TagClient.cs +++ b/src/Zammad.Client/TagClient.cs @@ -19,23 +19,23 @@ public TagClient(ZammadAccount account) public async Task> GetTagListAsync(string objectName, int objectId) { - var tagList = await GetAsync("/api/v1/tags", $"?object={objectName}&o_id={objectId}"); + var tagList = await GetAsync("/api/v1/tags", $"object={objectName}&o_id={objectId}"); return tagList.Tags; } public Task> SearchTagAsync(string term) { - return GetAsync>("/api/v1/tag_search", $"?term={term}"); + return GetAsync>("/api/v1/tag_search", $"term={term}"); } public Task AddTagAsync(string objectName, int objectId, string tagName) { - return GetAsync("/api/v1/tags/add", $"?object={objectName}&o_id={objectId}&item={tagName}"); + return GetAsync("/api/v1/tags/add", $"object={objectName}&o_id={objectId}&item={tagName}"); } public Task RemoveTagAsync(string objectName, int objectId, string tagName) { - return GetAsync("/api/v1/tags/remove", $"?object={objectName}&o_id={objectId}&item={tagName}"); + return GetAsync("/api/v1/tags/remove", $"object={objectName}&o_id={objectId}&item={tagName}"); } public Task> GetTagListAdminAsync() diff --git a/src/Zammad.Client/TicketClient.cs b/src/Zammad.Client/TicketClient.cs index 7811d1a..1875781 100644 --- a/src/Zammad.Client/TicketClient.cs +++ b/src/Zammad.Client/TicketClient.cs @@ -25,12 +25,12 @@ public Task> GetTicketListAsync() public Task> GetTicketListAsync(int page, int count) { - return GetAsync>("/api/v1/tickets", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/tickets", $"page={page},per_page={count}"); } public Task> SearchTicketAsync(string query, int limit) { - return GetAsync>("/api/v1/tickets/search", $"?query={query}&limit={limit}&expand=true"); + return GetAsync>("/api/v1/tickets/search", $"query={query}&limit={limit}&expand=true"); } public Task GetTicketAsync(int id) @@ -64,7 +64,7 @@ public Task> GetTicketArticleListAsync() public Task> GetTicketArticleListAsync(int page, int count) { - return GetAsync>("/api/v1/ticket_articles", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/ticket_articles", $"page={page},per_page={count}"); } public Task> GetTicketArticleListForTicketAsync(int ticketId) @@ -98,7 +98,7 @@ public Task> GetTicketPriorityListAsync() public Task> GetTicketPriorityListAsync(int page, int count) { - return GetAsync>("/api/v1/ticket_priorities", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/ticket_priorities", $"page={page},per_page={count}"); } public Task GetTicketPriorityAsync(int id) @@ -132,7 +132,7 @@ public Task> GetTicketStateListAsync() public Task> GetTicketStateListAsync(int page, int count) { - return GetAsync>("/api/v1/ticket_states", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/ticket_states", $"page={page},per_page={count}"); } public Task GetTicketStateAsync(int id) diff --git a/src/Zammad.Client/UserClient.cs b/src/Zammad.Client/UserClient.cs index 6c059ea..18743fb 100644 --- a/src/Zammad.Client/UserClient.cs +++ b/src/Zammad.Client/UserClient.cs @@ -28,12 +28,12 @@ public Task> GetUserListAsync() public Task> GetUserListAsync(int page, int count) { - return GetAsync>("/api/v1/users", $"?page={page},per_page={count}"); + return GetAsync>("/api/v1/users", $"page={page},per_page={count}"); } public Task> SearchUserAsync(string query, int limit) { - return GetAsync>("/api/v1/users/search", $"?query={query}&limit={limit}&expand=true"); + return GetAsync>("/api/v1/users/search", $"query={query}&limit={limit}&expand=true"); } public Task GetUserAsync(int id) From a5efd0b1037245e5f709e09d05d0bce3c8810f8a Mon Sep 17 00:00:00 2001 From: Asesjix Date: Tue, 14 Aug 2018 00:02:02 +0200 Subject: [PATCH 3/3] #19 --- src/Zammad.Client/Core/Protocol/HttpRequestBuilder.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Zammad.Client/Core/Protocol/HttpRequestBuilder.cs b/src/Zammad.Client/Core/Protocol/HttpRequestBuilder.cs index 511424b..072641f 100644 --- a/src/Zammad.Client/Core/Protocol/HttpRequestBuilder.cs +++ b/src/Zammad.Client/Core/Protocol/HttpRequestBuilder.cs @@ -122,7 +122,6 @@ public HttpRequestBuilder UseJsonContent(object json) { var serializer = new JsonSerializer { - DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, NullValueHandling = NullValueHandling.Ignore };