/Atlassian.Jira/IJiraUserService.cs

https://bitbucket.org/farmas/atlassian.net-sdk · C# · 81 lines · 17 code · 8 blank · 56 comment · 0 complexity · 3452bf80438f21d8aa8f025f34b135af MD5 · raw file

  1. using System.Collections.Generic;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. namespace Atlassian.Jira
  5. {
  6. /// <summary>
  7. /// Represents the operations on the users of jira.
  8. /// </summary>
  9. public interface IJiraUserService
  10. {
  11. /// <summary>
  12. /// Retrieve user specified by username.
  13. /// </summary>
  14. /// <param name="usernameOrAccountId">The username or account id of the user to get.</param>
  15. /// <param name="token">Cancellation token for this operation.</param>
  16. Task<JiraUser> GetUserAsync(string usernameOrAccountId, CancellationToken token = default(CancellationToken));
  17. /// <summary>
  18. /// Deletes a user by the given username.
  19. /// </summary>
  20. /// <param name="usernameOrAccountId">User name or account id of user to delete.</param>
  21. /// <param name="token">Cancellation token for this operation.</param>
  22. Task DeleteUserAsync(string usernameOrAccountId, CancellationToken token = default(CancellationToken));
  23. /// <summary>
  24. /// Returns a list of users that match the search string.
  25. /// </summary>
  26. /// <param name="query">String used to search username, name or e-mail address.</param>
  27. /// <param name="userStatus">The status(es) of users to include in the result.</param>
  28. /// <param name="maxResults">Maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.</param>
  29. /// <param name="startAt">Index of the first user to return (0-based).</param>
  30. /// <param name="token">Cancellation token for this operation.</param>
  31. Task<IEnumerable<JiraUser>> SearchUsersAsync(string query, JiraUserStatus userStatus = JiraUserStatus.Active, int maxResults = 50, int startAt = 0, CancellationToken token = default(CancellationToken));
  32. /// <summary>
  33. /// Searches assignable users for an issue.
  34. /// </summary>
  35. /// <param name="username">The username.</param>
  36. /// <param name="issueKey">The issue key.</param>
  37. /// <param name="startAt">Index of the first user to return (0-based).</param>
  38. /// <param name="maxResults">The maximum results.</param>
  39. /// <param name="token">Cancellation token for this operation.</param>
  40. Task<IEnumerable<JiraUser>> SearchAssignableUsersForIssueAsync(string username, string issueKey, int startAt = 0, int maxResults = 50, CancellationToken token = default(CancellationToken));
  41. /// <summary>
  42. /// Searches assignable users for a project.
  43. /// </summary>
  44. /// <param name="username">The username.</param>
  45. /// <param name="projectKey">The project key.</param>
  46. /// <param name="startAt">Index of the first user to return (0-based).</param>
  47. /// <param name="maxResults">The maximum results.</param>
  48. /// <param name="token">Cancellation token for this operation.</param>
  49. Task<IEnumerable<JiraUser>> SearchAssignableUsersForProjectAsync(string username, string projectKey, int startAt = 0, int maxResults = 50, CancellationToken token = default(CancellationToken));
  50. /// <summary>
  51. /// Searches the assignable users for a list of projects.
  52. /// </summary>
  53. /// <param name="username">The username.</param>
  54. /// <param name="projectKeys">The project keys.</param>
  55. /// <param name="startAt">The start at.</param>
  56. /// <param name="maxResults">Maximum number of users to return (defaults to 50). The
  57. /// maximum allowed value is 1000. If you specify a value that is higher than this number,
  58. /// your search results will be truncated.</param>
  59. /// <param name="token">Cancellation token for this operation.</param>
  60. Task<IEnumerable<JiraUser>> SearchAssignableUsersForProjectsAsync(string username, IEnumerable<string> projectKeys, int startAt = 0, int maxResults = 50, CancellationToken token = default(CancellationToken));
  61. /// <summary>
  62. /// Creates a user.
  63. /// </summary>
  64. /// <param name="user">The information about the user to be created.</param>
  65. /// <param name="token">Cancellation token for this operation.</param>
  66. Task<JiraUser> CreateUserAsync(JiraUserCreationInfo user, CancellationToken token = default(CancellationToken));
  67. /// <summary>
  68. /// Retrieve user currently connected.
  69. /// </summary>
  70. /// <param name="token">Cancellation token for this operation.</param>
  71. Task<JiraUser> GetMyselfAsync(CancellationToken token = default(CancellationToken));
  72. }
  73. }