public async Task <BaseFsEntry> Rename(string path, string newName) { var fullpath = GetFullPath(path); var newPath = CombinePath(GetParentPath(fullpath), newName); var result = await Client.Move(fullpath, newPath); if (result.IsSuccessful) { var directoryInfo = await GetDirectoryInfo(newPath); return(Convert(directoryInfo.Directory, directoryInfo.DirectoryItems.Any(r => r.IsCollection))); } else { throw new InvalidOperationException($"Status code: {result.StatusCode}. Description: {result.Description}"); } }