Skip to content

Commit

Permalink
Merge f5b1c4b into b052aa6
Browse files Browse the repository at this point in the history
  • Loading branch information
jmprovencher authored Mar 8, 2018
2 parents b052aa6 + f5b1c4b commit 4a45e2a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/ZendeskApi_v2/Requests/Users.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using ZendeskApi_v2.Extensions;

Expand Down Expand Up @@ -62,7 +62,7 @@ public interface IUsers : ICore

GroupUserResponse GetUsersInGroup(long id);

GroupUserResponse GetUsersInOrganization(long id);
GroupUserResponse GetUsersInOrganization(long id, int? perPage = null, int? page = null, UserSideLoadOptions sideLoadOptions = UserSideLoadOptions.None);

IndividualUserResponse CreateUser(User user);

Expand Down Expand Up @@ -138,7 +138,7 @@ public interface IUsers : ICore

Task<GroupUserResponse> GetUsersInGroupAsync(long id);

Task<GroupUserResponse> GetUsersInOrganizationAsync(long id);
Task<GroupUserResponse> GetUsersInOrganizationAsync(long id, int? perPage = null, int? page = null, UserSideLoadOptions sideLoadOptions = UserSideLoadOptions.None);

Task<IndividualUserResponse> CreateUserAsync(User user);

Expand Down Expand Up @@ -310,9 +310,10 @@ public GroupUserResponse GetUsersInGroup(long id)
return GenericGet<GroupUserResponse>($"groups/{id}/users.json");
}

public GroupUserResponse GetUsersInOrganization(long id)
public GroupUserResponse GetUsersInOrganization(long id, int? perPage = null, int? page = null, UserSideLoadOptions sideLoadOptions = UserSideLoadOptions.None)
{
return GenericGet<GroupUserResponse>($"organizations/{id}/users.json");
var resource = GetResourceStringWithSideLoadOptionsParam($"organizations/{id}/users.json", sideLoadOptions);
return GenericPagedGet<GroupUserResponse>(resource, perPage, page);
}

public IndividualUserResponse CreateUser(User user)
Expand Down Expand Up @@ -523,9 +524,10 @@ public async Task<GroupUserResponse> GetUsersInGroupAsync(long id)
return await GenericGetAsync<GroupUserResponse>($"groups/{id}/users.json");
}

public async Task<GroupUserResponse> GetUsersInOrganizationAsync(long id)
public async Task<GroupUserResponse> GetUsersInOrganizationAsync(long id, int? perPage = null, int? page = null, UserSideLoadOptions sideLoadOptions = UserSideLoadOptions.None)
{
return await GenericGetAsync<GroupUserResponse>($"organizations/{id}/users.json");
var resource = GetResourceStringWithSideLoadOptionsParam($"organizations/{id}/users.json", sideLoadOptions);
return await GenericPagedGetAsync<GroupUserResponse>(resource, perPage, page);
}

public async Task<IndividualUserResponse> CreateUserAsync(User user)
Expand Down

0 comments on commit 4a45e2a

Please sign in to comment.