Call Wiki webapi tokens action

@throws BuildException
14654
private function callApiTokens()
    {
        $result = $this->callApi('action=tokens&type=edit');
        if (false == isset($result['tokens']) || false == isset($result['tokens']['edittoken'])) {
            throw new BuildException('Wiki token not found');
        }

        $this->apiEditToken = $result['tokens']['edittoken'];
    }
1038801
private function jwt()
    {
        if (!$this->jwt) {
            if (!$this->accessToken) {
                throw new EndpointException("No access token was provided");
            }

            $this->jwt = (new Parser())->parse($this->accessToken);
            $this->checkSignature();
        }
    }
1069636
public function call()
    {
        if (empty($this->options)) {
            $this->options = $this->app->config('bono.controllers');
        }

        if (empty($this->options['mapping'])) {
            return $this->next->call();
        }

        $mapping = $this->options['mapping'];

        $resourceUri = $this->app->request->getResourceUri();
        if ($mapping) {
            foreach ($mapping as $uri => $Map) {
                if (is_int($uri)) {
                    $uri = $Map;
                    $Map = null;
                }

                $matcher = preg_replace('/:\w+/', '(\w+)', '/^'.addcslashes($uri, '\/').'(?:\/.*)*$/');
                $matches = '';
                $isMatch = preg_match($matcher, $resourceUri, $matches);

                if ($isMatch)  {
                    if (is_null($Map)) {
                        if (isset($this->options['default'])) {
                            $Map = $this->options['default'];
                        } else {
                            throw new \Exception('URI "'.$uri.'" does not have suitable controller class "'.$Map.'"');
                        }
                    }
                    $this->app->controller = $controller = new $Map($this->app, $uri);
                    if (!($controller instanceof \Bono\Controller\Controller)) {
                        throw new \Exception(
                            'Controller "'.$Map.'" should be instance of Bono\Controller\Controller.'
                        );
                    }
                    break;
                }
            }
        }

        $this->next->call();
    }
897685
function executeApi(apiName, opts, extras){

  var emitter = new Emitter()
    , apiItem
    , token = opts.access_token
    , form, method, path
    , url
    ;
  
  if(/^(https?:\/\/|\/)/.test(apiName)){
    if(apiName.indexOf('/') === 0){
      url = api.HOST + apiName;
    }else{
      url = apiName;
    }
    extras = extras || {};
    method = extras.method;
    
  }else{
    apiItem = getApiItem(apiName);
    if(!apiItem){
      process.nextTick(function(){
        emitter.emit('error', 'no or not support api: ' + apiName);
      });
      return emitter;
    }
    
    path = apiItem.path;
    method = apiItem.method;
    
    url = api.HOST + api.PREPATH + path + '.json';
  }
  
  if(method == 'post'){
    form = opts;
    opts = {};
  }
  
  delete opts.access_token;
  
  request({
      url: url + '?access_token=' + token
    , method: method
    , qs: opts
    , form: form
  }, function(err, res, reply){
    if(err){
      emitter.emit('error', err);
    }else{
      try{
        reply = JSON.parse(reply);
        emitter.emit('success', reply);
      }catch(e){
        emitter.emit('error', reply);
      }
    }
  });
  
  return emitter;
}
895415
@Override
    public JwtToken buildJwt() throws JwtException, InvalidBuilderException {
        // Create JWT here
        // TODO check for default claims?
        JwtConfig config = getConfig(configId);
        JwtToken jwt = new TokenImpl(this, config);

        return jwt;
    }
275778
private <TResponse> void callServiceDeleteApi(String path) throws AuthleteApiException
    {
        callServiceDeleteApi(path, (Map<String, String>)null);
    }
1229785
protected function execute()
    {
        $authMethod = '?access_token=' . $this->params['access_token'];
        $endpoint = Constants::API_VERSION . $this->path . (('GET' === $this->method) ? '?' . http_build_query($this->params) : $authMethod);
        $endpoint .= (strstr($endpoint, '?') ? '&' : '?') . 'sig=' . static::generateSignature($this->instagram->getApp(), $this->path, $this->params);

        $request = HelperFactory::getInstance()->request($this->instagram->getHttpClient(), $endpoint, $this->params, $this->method);

        if ($request === null) {
            throw new InstagramResponseException('400 Bad Request: instanceof InstagramResponse cannot be null', 400);
        }
        $this->response = new InstagramResponse($request);
        $this->xRateLimitRemaining = $this->response->getHeader('X-Ratelimit-Remaining');
    }
845364
@Override
    public void execute() throws BuildException {
        try {
            ProvisioningFeatureDefinition feature = new SubsystemFeatureDefinitionImpl(null, this.featureManifestFile);
            String description = generateDescriptionHtml(feature, this.generateKnowledgeCentreLinks, this.licenseType);
            Files.write(this.descriptionHtmlOutputFile.toPath(), description.getBytes());
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
40869
@Override
  public void execute() throws Exception {
    ApiClient apiClient = new ApiClient(ApiClient.getToken(), false);
    int rateRemain = apiClient.getRateLimitRemain();
    System.out.println("Your Github API token is valid.");
    System.out.println(rateRemain+ " requests remaining.");
  }
877761
public function load()
    {
        // Create new Reader
        if ($this->classname === null) {
            throw new BuildException("No Classname given to TokenSource.");
        }

        $classname = Phing::import($this->classname);
        $this->reader = new $classname($this->project);

        // Configure Reader
        $this->configureTokenReader($this->reader);

        // Load Tokens
        try {
            while ($token = $this->reader->readToken()) {
                $this->tokens[] = $token;
            }
        } catch (BuildException $e) {
            $this->log("Error reading TokenSource: " . $e->getMessage(), Project::MSG_WARN);
        } catch (IOException $e) {
            $this->log("Error reading TokenSource: " . $e->getMessage(), Project::MSG_WARN);
        }
    }
511738
public void execute()
			throws BuildException
	{
		try
		{
			verboseHeaderToLog();

			List<String> args = buildCommandLine();

			verboseCommandLineToLog(args);

			doRun(args);

		}
        catch (BuildException ex) {
            throw ex;
        }
		catch (Exception ex)
		{
			throw new BuildException("AntTaskRunner", ex);
		}
	}
102568
private function validateAttributes()
    {
        if (null === $this->apiUrl) {
            throw new BuildException('Wiki apiUrl is required');
        }

        if (null === $this->id && null === $this->title) {
            throw new BuildException('Wiki page id or title is required');
        }
    }
947545
public function buildTemplateAction()
    {
        $templateAction = BuildUtil::removeNullElements([
            'type' => ActionType::URI,
            'label' => $this->label,
            'uri' => $this->uri,
        ]);

        if ($this->altUri) {
            $templateAction['altUri'] = $this->altUri->build();
        }

        return $templateAction;
    }
706960
public function main()
    {
        if ($this->name === null) {
            throw new BuildException("The name attribute is required for adhoc task definition.", $this->getLocation());
        }

        $taskdefs = $this->getProject()->getTaskDefinitions();

        if (!isset($taskdefs[$this->name])) {
            $this->execute();

            $classes = $this->getNewClasses();

            if (count($classes) < 1) {
                throw new BuildException("You must define at least one class for AdhocTaskdefTask.");
            }

            $classname = array_pop($classes);

            // instantiate it to make sure it is an instance of Task
            $t = new $classname();
            if (!($t instanceof Task)) {
                throw new BuildException(
                    "The adhoc class you defined must be an instance of phing.Task",
                    $this->getLocation()
                );
            }

            $this->log("Task " . $this->name . " will be handled by class " . $classname, Project::MSG_VERBOSE);
            $this->project->addTaskDefinition($this->name, $classname);
        }
    }
653017
public function main(){
        
        if(is_null($this->getDomain())){
            throw new \BuildException('the domain property is required');
        }

        if(is_null($this->getName())){
            throw new \BuildException('the name property is required');
        }

        if(is_null($this->getVersion())){
            throw new \BuildException('the version property is required');
        }

        if(is_null($this->getTasklist())){
            throw new \BuildException('the tasklist property is required');
        }

        try {
            $activity = $this->getService()->describeActivityType([
                'domain' => $this->getDomain(),
                'activityType' => [
                    'name' => $this->getName(),
                    'version' => $this->getVersion()
                ]
            ]);

            if ($activity->get('typeInfo')['status'] != 'REGISTERED') {
                throw new \BuildException('the activity "' . $this->getName() . '" is no more available');
            }

            $this->log('The activity "' . $this->getName() . '" already exists');
        } catch (SwfException $e) {
            $this->log('Creating "' . $this->getName() . '" v.' . $this->getVersion() . ' activity');

            $params = [
                'domain' => $this->getDomain(),
                'name' => $this->getName(),
                'version' => $this->getVersion(),
                'description' => $this->getDescription(),
                'defaultTaskStartToCloseTimeout' => $this->getStartToCloseTimeout() ?: 'NONE',
                'defaultTaskHeartbeatTimeout' => $this->getHeartbeatTimeout() ?: 'NONE',
                'defaultTaskScheduleToStartTimeout' => $this->getScheduleToStartTimeout() ?: 'NONE',
                'defaultTaskScheduleToCloseTimeout' => $this->getScheduleToCloseTimeout() ?: 'NONE',
                'defaultTaskList' => [
                    'name' => $this->getTasklist()
                ]
            ];

            $this->getService()->registerActivityType($params);

            $this->log('"' . $this->getName() . '" v.' . $this->getVersion() . ' activity successfully created');
        }
    }
124157
protected function executeRebuildActions($action = 'beforeRebuild')
    {
        if (!isset($this->rebuildActionClasses)) {
            $this->initRebuildActions();
        }

        if (isset($this->rebuildActionClasses[$action])) {
            foreach ($this->rebuildActionClasses[$action] as $rebuildActionClass) {
                $rebuildActionClass->$action();
            }
        }
    }
464669
function handleCustomHTTPActions( $http, $attributeDataBaseName,
                                      $customActionAttributeArray, $customActionParameters )
    {
        $dataType = $this->dataType();
        if ( $dataType )
        {
            $customActionParameters['contentobject_attribute'] = $this;
            $dataType->handleCustomObjectHTTPActions( $http, $attributeDataBaseName,
                                                      $customActionAttributeArray, $customActionParameters );
        }
    }