3 final class TokenGivenConduitAPIMethod
extends TokenConduitAPIMethod
{
5 public function getAPIMethodName() {
9 public function getMethodDescription() {
10 return pht('Query tokens given to objects.');
13 protected function defineParamTypes() {
15 'authorPHIDs' => 'list<phid>',
16 'objectPHIDs' => 'list<phid>',
17 'tokenPHIDs' => 'list<phid>',
21 protected function defineReturnType() {
25 protected function execute(ConduitAPIRequest
$request) {
26 $query = id(new PhabricatorTokenGivenQuery())
27 ->setViewer($request->getUser());
29 $author_phids = $request->getValue('authorPHIDs');
31 $query->withAuthorPHIDs($author_phids);
34 $object_phids = $request->getValue('objectPHIDs');
36 $query->withObjectPHIDs($object_phids);
39 $token_phids = $request->getValue('tokenPHIDs');
41 $query->withTokenPHIDs($token_phids);
44 $given = $query->execute();
46 return $this->buildTokenGivenDicts($given);