public MoveUserFolderAsync ( string userId, string ownedByUserId, string folderId = "0", bool notify = false ) : Task |
||
userId | string | Id of the user. |
ownedByUserId | string | The ID of the user who the folder will be transferred to. |
folderId | string | Currently only moving of the root folder (0) is supported. |
notify | bool | Determines if the destination user should receive email notification of the transfer. |
return | Task |
public async Task<BoxFolder> MoveUserFolderAsync(string userId, string ownedByUserId, string folderId = "0", bool notify = false)
{
userId.ThrowIfNullOrWhiteSpace("userId");
ownedByUserId.ThrowIfNullOrWhiteSpace("ownedByUserId");
folderId.ThrowIfNullOrWhiteSpace("folderId");
BoxRequest request = new BoxRequest(_config.UserEndpointUri, string.Format(Constants.MoveUserFolderPathString, userId, folderId))
.Param("notify", notify.ToString())
.Payload(_converter.Serialize(new BoxMoveUserFolderRequest()
{
OwnedBy = new BoxUserRequest()
{
Id = ownedByUserId
}
}))
.Method(RequestMethod.Put);
IBoxResponse<BoxFolder> response = await ToResponseAsync<BoxFolder>(request).ConfigureAwait(false);
return response.ResponseObject;
}