Box.V2.Managers.BoxUsersManager.MoveUserFolderAsync C# (CSharp) Method

MoveUserFolderAsync() public method

Moves all of the owned content from within one user’s folder into a new folder in another user’s account. You can move folders across users as long as the you have administrative permissions and the ‘source’ user owns the folders. To move everything from the root folder, use “0” which always represents the root folder of a Box account.
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;
        }