Skip to content

Commit

Permalink
Merge pull request #20 from Asesjix/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
S3bt3r authored Aug 13, 2018
2 parents 891fc9d + a5efd0b commit d8a47bc
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 38 deletions.
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

12 changes: 6 additions & 6 deletions samples/Zammad.Connector/Zammad.Connector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>

Expand All @@ -23,11 +23,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Zammad.Client/Core/Protocol/HttpRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public HttpRequestBuilder UseJsonContent(object json)
{
var serializer = new JsonSerializer
{
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
NullValueHandling = NullValueHandling.Ignore
};

Expand Down
2 changes: 1 addition & 1 deletion src/Zammad.Client/GroupClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Task<IList<Group>> GetGroupListAsync()

public Task<IList<Group>> GetGroupListAsync(int page, int count)
{
return GetAsync<IList<Group>>("/api/v1/groups", $"?page={page},per_page={count}");
return GetAsync<IList<Group>>("/api/v1/groups", $"page={page},per_page={count}");
}

public Task<Group> GetGroupAsync(int id)
Expand Down
2 changes: 1 addition & 1 deletion src/Zammad.Client/OnlineNotificationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Task<IList<OnlineNotification>> GetOnlineNotificationListAsync()

public Task<IList<OnlineNotification>> GetOnlineNotificationListAsync(int page, int count)
{
return GetAsync<IList<OnlineNotification>>("/api/v1/online_notifications", $"?page={page},per_page={count}");
return GetAsync<IList<OnlineNotification>>("/api/v1/online_notifications", $"page={page},per_page={count}");
}

public Task<OnlineNotification> GetOnlineNotificationAsync(int id)
Expand Down
4 changes: 2 additions & 2 deletions src/Zammad.Client/OrganizationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public Task<IList<Organization>> GetOrganizationListAsync()

public Task<IList<Organization>> GetOrganizationListAsync(int page, int count)
{
return GetAsync<IList<Organization>>("/api/v1/organizations", $"?page={page},per_page={count}");
return GetAsync<IList<Organization>>("/api/v1/organizations", $"page={page},per_page={count}");
}

public Task<IList<Organization>> SearchOrganizationAsync(string query, int limit)
{
return GetAsync<IList<Organization>>("/api/v1/organizations/search", $"?query={query}&limit={limit}&expand=true");
return GetAsync<IList<Organization>>("/api/v1/organizations/search", $"query={query}&limit={limit}&expand=true");
}

public Task<Organization> GetOrganizationAsync(int id)
Expand Down
8 changes: 4 additions & 4 deletions src/Zammad.Client/TagClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ public TagClient(ZammadAccount account)

public async Task<IList<Tag>> GetTagListAsync(string objectName, int objectId)
{
var tagList = await GetAsync<TagList>("/api/v1/tags", $"?object={objectName}&o_id={objectId}");
var tagList = await GetAsync<TagList>("/api/v1/tags", $"object={objectName}&o_id={objectId}");
return tagList.Tags;
}

public Task<IList<Tag>> SearchTagAsync(string term)
{
return GetAsync<IList<Tag>>("/api/v1/tag_search", $"?term={term}");
return GetAsync<IList<Tag>>("/api/v1/tag_search", $"term={term}");
}

public Task<bool> 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<bool> 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<IList<Tag>> GetTagListAdminAsync()
Expand Down
10 changes: 5 additions & 5 deletions src/Zammad.Client/TicketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public Task<IList<Ticket>> GetTicketListAsync()

public Task<IList<Ticket>> GetTicketListAsync(int page, int count)
{
return GetAsync<IList<Ticket>>("/api/v1/tickets", $"?page={page},per_page={count}");
return GetAsync<IList<Ticket>>("/api/v1/tickets", $"page={page},per_page={count}");
}

public Task<IList<Ticket>> SearchTicketAsync(string query, int limit)
{
return GetAsync<IList<Ticket>>("/api/v1/tickets/search", $"?query={query}&limit={limit}&expand=true");
return GetAsync<IList<Ticket>>("/api/v1/tickets/search", $"query={query}&limit={limit}&expand=true");
}

public Task<Ticket> GetTicketAsync(int id)
Expand Down Expand Up @@ -64,7 +64,7 @@ public Task<IList<TicketArticle>> GetTicketArticleListAsync()

public Task<IList<TicketArticle>> GetTicketArticleListAsync(int page, int count)
{
return GetAsync<IList<TicketArticle>>("/api/v1/ticket_articles", $"?page={page},per_page={count}");
return GetAsync<IList<TicketArticle>>("/api/v1/ticket_articles", $"page={page},per_page={count}");
}

public Task<IList<TicketArticle>> GetTicketArticleListForTicketAsync(int ticketId)
Expand Down Expand Up @@ -98,7 +98,7 @@ public Task<IList<TicketPriority>> GetTicketPriorityListAsync()

public Task<IList<TicketPriority>> GetTicketPriorityListAsync(int page, int count)
{
return GetAsync<IList<TicketPriority>>("/api/v1/ticket_priorities", $"?page={page},per_page={count}");
return GetAsync<IList<TicketPriority>>("/api/v1/ticket_priorities", $"page={page},per_page={count}");
}

public Task<TicketPriority> GetTicketPriorityAsync(int id)
Expand Down Expand Up @@ -132,7 +132,7 @@ public Task<IList<TicketState>> GetTicketStateListAsync()

public Task<IList<TicketState>> GetTicketStateListAsync(int page, int count)
{
return GetAsync<IList<TicketState>>("/api/v1/ticket_states", $"?page={page},per_page={count}");
return GetAsync<IList<TicketState>>("/api/v1/ticket_states", $"page={page},per_page={count}");
}

public Task<TicketState> GetTicketStateAsync(int id)
Expand Down
4 changes: 2 additions & 2 deletions src/Zammad.Client/UserClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public Task<IList<User>> GetUserListAsync()

public Task<IList<User>> GetUserListAsync(int page, int count)
{
return GetAsync<IList<User>>("/api/v1/users", $"?page={page},per_page={count}");
return GetAsync<IList<User>>("/api/v1/users", $"page={page},per_page={count}");
}

public Task<IList<User>> SearchUserAsync(string query, int limit)
{
return GetAsync<IList<User>>("/api/v1/users/search", $"?query={query}&limit={limit}&expand=true");
return GetAsync<IList<User>>("/api/v1/users/search", $"query={query}&limit={limit}&expand=true");
}

public Task<User> GetUserAsync(int id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Zammad.Client.IntegrationTests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions test/Zammad.Client.Tests/Zammad.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="moq" Version="4.8.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="moq" Version="4.9.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit d8a47bc

Please sign in to comment.