Package ch.aaap.harvestclient.api
Interface UsersApi
- All Superinterfaces:
Api.Create<User>
,Api.Delete<User>
,Api.Get<User>
,Api.Simple<User>
- All Known Implementing Classes:
UsersApiImpl
API for UserAssignments. All methods are specific to a given project
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new User.void
Delete a user.Retrieve an existing usergetSelf()
Retrieve the currently authenticated userlist()
Returns a list of your users.Return a list of users, filtered by activity and update date, newest user first.Return a list of users, filtered by activity and update date, newest user first.update
(Reference<User> user, UserUpdateInfo toChange) Change an existing user.
-
Method Details
-
list
Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first. This method does not filter results. Same as list(null, null);- Returns:
- a list of all users
-
list
Return a list of users, filtered by activity and update date, newest user first.- Parameters:
isActive
- if true, return only getActive users. Set to null to disable filteringupdatedSince
- return only users that have been updated at least 1 second after updatedSince. Set to null to disable filtering.- Returns:
- a list of all users, filtered accordingly
-
list
Return a list of users, filtered by activity and update date, newest user first. Page and perPage allow controlling how many results to return.- Parameters:
isActive
- if true, return only getActive users. Set to null to disable filteringupdatedSince
- return only users that have been updated at least 1 second after updatedSince. Set to null to disable filtering.page
- the page numberperPage
- how many results to return for one page. Max 100- Returns:
- a list of users, filtered accordingly
-
create
Create a new User. First name, last name and email are required.- Specified by:
create
in interfaceApi.Create<User>
- Parameters:
userCreationInfo
- a user creation object with the wanted properties. Null fields will get a default value according to the Harvest docs- Returns:
- the User that was just created
-
getSelf
User getSelf()Retrieve the currently authenticated user- Returns:
- the currently authenticated user
-
get
Retrieve an existing user -
update
Change an existing user.- Parameters:
user
- a reference to an existing UsertoChange
- The properties to be changed. Null fields will be left as is.- Returns:
- the updated User
-
delete
Delete a user. Deleting a user is only possible if they have no time entries or expenses associated with them- Specified by:
delete
in interfaceApi.Delete<User>
- Parameters:
userReference
- a reference to an existing User to be deleted
-