Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/conduit/FileAllocateConduitAPIMethod.php
<?php | <?php | ||||
final class FileAllocateConduitAPIMethod | final class FileAllocateConduitAPIMethod | ||||
extends FileConduitAPIMethod { | extends FileConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'file.allocate'; | return 'file.allocate'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return pht('Prepare to upload a file.'); | return pht('Prepare to upload a file.'); | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'name' => 'string', | 'name' => 'string', | ||||
'contentLength' => 'int', | 'contentLength' => 'int', | ||||
'contentHash' => 'optional string', | 'contentHash' => 'optional string', | ||||
'viewPolicy' => 'optional string', | 'viewPolicy' => 'optional string', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'map<string, wild>'; | return 'map<string, wild>'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array(); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$hash = $request->getValue('contentHash'); | $hash = $request->getValue('contentHash'); | ||||
$name = $request->getValue('name'); | $name = $request->getValue('name'); | ||||
$view_policy = $request->getValue('viewPolicy'); | $view_policy = $request->getValue('viewPolicy'); | ||||
$length = $request->getValue('contentLength'); | $length = $request->getValue('contentLength'); | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |