Differential D12380 Diff 29771 src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php
<?php | <?php | ||||
final class ManiphestCreateTaskConduitAPIMethod | final class ManiphestCreateTaskConduitAPIMethod | ||||
extends ManiphestConduitAPIMethod { | extends ManiphestConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'maniphest.createtask'; | return 'maniphest.createtask'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Create a new Maniphest task.'; | return 'Create a new Maniphest task.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return $this->getTaskFields($is_new = true); | return $this->getTaskFields($is_new = true); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'nonempty dict'; | return 'nonempty dict'; | ||||
} | } | ||||
public function defineErrorTypes() { | protected function defineErrorTypes() { | ||||
return array( | return array( | ||||
'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', | 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', | ||||
); | ); | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$task = ManiphestTask::initializeNewTask($request->getUser()); | $task = ManiphestTask::initializeNewTask($request->getUser()); | ||||
$task = $this->applyRequest($task, $request, $is_new = true); | $task = $this->applyRequest($task, $request, $is_new = true); | ||||
return $this->buildTaskInfoDictionary($task); | return $this->buildTaskInfoDictionary($task); | ||||
} | } | ||||
} | } |