Skip to content

Commit

Permalink
fix some minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lvermeulen committed Apr 27, 2019
1 parent 9121ba3 commit bfcf039
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 38 deletions.
6 changes: 3 additions & 3 deletions src/JiraServiceDesk.Net/Customer/JiraServiceDeskClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Threading.Tasks;
using Flurl.Http;
using JiraServiceDesk.Net.Models.Customer;
using JiraServiceDesk.Net.Models.Common;

namespace JiraServiceDesk.Net
{
Expand All @@ -9,7 +9,7 @@ public partial class JiraServiceDeskClient
private IFlurlRequest GetCustomerUrl() => GetBaseUrl()
.AppendPathSegment("/customer");

public async Task<Customer> CreateCustomerAsync(string email, string fullName)
public async Task<User> CreateCustomerAsync(string email, string fullName)
{
var data = new
{
Expand All @@ -21,7 +21,7 @@ public async Task<Customer> CreateCustomerAsync(string email, string fullName)
.PostJsonAsync(data)
.ConfigureAwait(false);

return await HandleResponseAsync<Customer>(response).ConfigureAwait(false);
return await HandleResponseAsync<User>(response).ConfigureAwait(false);
}
}
}
9 changes: 7 additions & 2 deletions src/JiraServiceDesk.Net/Models/Common/PagedResults.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace JiraServiceDesk.Net.Models.Common
{
public class PagedResults<T> : PagedResultsBase
public class PagedResults<T>
{
[JsonProperty("_expands")]
public List<string> Expands { get; set; }
public int Start { get; set; }
public int Limit { get; set; }
public int Size { get; set; }
public bool IsLastPage { get; set; }
public List<T> Values { get; set; }
public int? NextPageStart { get; set; }
}
}
14 changes: 0 additions & 14 deletions src/JiraServiceDesk.Net/Models/Common/PagedResultsBase.cs

This file was deleted.

14 changes: 0 additions & 14 deletions src/JiraServiceDesk.Net/Models/Customer/Customer.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public async Task<PagedResults<User>> AddUsersToOrganizationAsync(string id, IEn
{
var data = new
{
usernames = userNames
usernames = string.Join(",", userNames)
};

var response = await GetOrganizationUrl($"/{id}/user")
Expand Down
8 changes: 4 additions & 4 deletions src/JiraServiceDesk.Net/ServiceDesk/JiraServiceDeskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ await GetServiceDeskUrl(serviceDeskId)
.ConfigureAwait(false);
}

public async Task<bool> AddServiceDeskOrganizationAsync(string serviceDeskId, int organizationId)
public async Task<bool> AddServiceDeskOrganizationAsync(string serviceDeskId, string organizationId)
{
var data = new
{
organizationId
organizationId = int.Parse(organizationId)
};

var response = await GetServiceDeskUrl(serviceDeskId)
Expand All @@ -102,11 +102,11 @@ public async Task<bool> AddServiceDeskOrganizationAsync(string serviceDeskId, in
return await HandleResponseAsync(response).ConfigureAwait(false);
}

public async Task<bool> RemoveServiceDeskOrganizationAsync(string serviceDeskId, int organizationId)
public async Task<bool> RemoveServiceDeskOrganizationAsync(string serviceDeskId, string organizationId)
{
var data = new
{
organizationId
organizationId = int.Parse(organizationId)
};

var response = await GetServiceDeskUrl(serviceDeskId)
Expand Down

0 comments on commit bfcf039

Please sign in to comment.