public Task <IEnumerable <JiraUser> > SearchUsersAsync(string query, JiraUserStatus userStatus = JiraUserStatus.Active, int maxResults = 50, int startAt = 0, CancellationToken token = default(CancellationToken)) { var queryParameters = new Dictionary <string, string>(); queryParameters.Add("username", Uri.EscapeDataString(query)); queryParameters.Add("includeActive", userStatus.HasFlag(JiraUserStatus.Active).ToString()); queryParameters.Add("includeInactive", userStatus.HasFlag(JiraUserStatus.Inactive).ToString()); queryParameters.Add("startAt", startAt.ToString()); queryParameters.Add("maxResults", maxResults.ToString()); return(_jira.RestClient.ExecuteRequestAsync <IEnumerable <JiraUser> >(Method.GET, "rest/api/latest/user/search", queryParameters, null, token)); }
public Task <IEnumerable <JiraUser> > SearchUsersAsync(string query, JiraUserStatus userStatus = JiraUserStatus.Active, int maxResults = 50, int startAt = 0, CancellationToken token = default(CancellationToken)) { var resource = String.Format( "rest/api/2/user/search?username={0}&includeActive={1}&includeInactive={2}&startAt={3}&maxResults={4}", Uri.EscapeDataString(query), userStatus.HasFlag(JiraUserStatus.Active), userStatus.HasFlag(JiraUserStatus.Inactive), startAt, maxResults); return(_jira.RestClient.ExecuteRequestAsync <IEnumerable <JiraUser> >(Method.GET, resource, null, token)); }