3 final class MacroCreateMemeConduitAPIMethod
extends MacroConduitAPIMethod
{
5 public function getAPIMethodName() {
6 return 'macro.creatememe';
9 public function getMethodStatus() {
10 return self
::METHOD_STATUS_UNSTABLE
;
13 public function getMethodDescription() {
14 return pht('Generate a meme.');
17 protected function defineParamTypes() {
19 'macroName' => 'string',
20 'upperText' => 'optional string',
21 'lowerText' => 'optional string',
25 protected function defineReturnType() {
29 protected function defineErrorTypes() {
31 'ERR-NOT-FOUND' => pht('Macro was not found.'),
35 protected function execute(ConduitAPIRequest
$request) {
36 $user = $request->getUser();
38 $file = id(new PhabricatorMemeEngine())
40 ->setTemplate($request->getValue('macroName'))
41 ->setAboveText($request->getValue('upperText'))
42 ->setBelowText($request->getValue('lowerText'))
46 'uri' => $file->getViewURI(),