You are here

public function SmartlingApi::renameFile in TMGMT Translator Smartling 8

Renames an uploaded file by changing the fileUri.

After renaming the file, the file will only be identified by the new fileUri you provide.

Parameters

string $fileUri: Current value that uniquely identifies the file.

string $newFileUri: The new value for fileUri. We recommend that you use file path + file name, similar to how version control systems identify the file.

array $params:

Return value

string Just empty string if everything was successfully.

Throws

\Drupal\tmgmt_smartling\Smartling\SmartlingApiException

See also

http://docs.smartling.com/pages/API/FileAPI/Rename/

File

src/Smartling/SmartlingApi.php, line 341

Class

SmartlingApi

Namespace

Drupal\tmgmt_smartling\Smartling

Code

public function renameFile($fileUri, $newFileUri, $params = []) {
  $params['fileUri'] = $fileUri;
  $params['newFileUri'] = $newFileUri;
  return $this
    ->sendRequest('file/rename', $params, 'POST');
}