@param       $apiName
@param array $operation
@param array $api

@return string
353240
protected function generateMethod($apiName, $operation = [], $api = [])
    {

        $filterParams = compact('apiName', 'operation', 'api');
        $method = [' * @method', 'array'];

        $data = "";
        $request = $api['request'];
        $description = $this->sanitizeDescription($request['description'], ['noMarkdown' => true, 'shorten' => true]);
        $description = $this->applyFilter('DocMethodDescription', $description, $filterParams);
        $params = $this->applyFilter('DocMethodParams', $operation['parameters'], $filterParams);
        $filterParams['params'] = $params;
        if (!empty($params)) {
            $data = $this->applyFilter('DocMethodData', 'array $parameters', $filterParams);
        }

        $method[] = $this->applyFilter('DocMethodSignature', "$apiName($data)", $filterParams);
        $method[] = $description;

        return implode("\t", $method);

    }
272255
public static function parseOperationName(Operation $operation)
    {
        $verb = self::deriveAction($operation->httpMethod, $operation->uri);

        $wordifiedPath = self::wordifyPath($operation->uri);

        if ($operation->version == 'stream') {
            $wordifiedPath = $wordifiedPath.'Stream';
        }

        if (preg_match("/^\/{urlname}.*/", $operation->uri) == 1) {
            $wordifiedPath = 'Group'.$wordifiedPath;
        }

        return ucfirst($verb.$wordifiedPath);
    }
377292
public function api($name)
    {
        switch ($name) {
            case 'me':
            case 'current_user':
            case 'currentUser':
                $api = new Api\CurrentUser($this);
                break;
            case 'codeOfConduct':
                $api = new Api\Miscellaneous\CodeOfConduct($this);
                break;

            case 'deployment':
            case 'deployments':
                $api = new Api\Deployment($this);
                break;

            case 'ent':
            case 'enterprise':
                $api = new Api\Enterprise($this);
                break;

            case 'emojis':
                $api = new Api\Miscellaneous\Emojis($this);
                break;

            case 'git':
            case 'git_data':
            case 'gitData':
                $api = new Api\GitData($this);
                break;

            case 'gist':
            case 'gists':
                $api = new Api\Gists($this);
                break;

            case 'gitignore':
                $api = new Api\Miscellaneous\Gitignore($this);
                break;

            case 'integration':
            case 'integrations':
                $api = new Api\Integrations($this);
                break;

            case 'apps':
                $api = new Api\Apps($this);
                break;

            case 'issue':
            case 'issues':
                $api = new Api\Issue($this);
                break;

            case 'markdown':
                $api = new Api\Markdown($this);
                break;

            case 'licenses':
                $api = new Api\Miscellaneous\Licenses($this);
                break;

            case 'notification':
            case 'notifications':
                $api = new Api\Notification($this);
                break;

            case 'organization':
            case 'organizations':
                $api = new Api\Organization($this);
                break;

            case 'org_project':
            case 'orgProject':
            case 'org_projects':
            case 'orgProjects':
            case 'organization_project':
            case 'organizationProject':
            case 'organization_projects':
            case 'organizationProjects':
                $api = new Api\Organization\Projects($this);
                break;

            case 'pr':
            case 'pulls':
            case 'pullRequest':
            case 'pull_request':
            case 'pullRequests':
            case 'pull_requests':
                $api = new Api\PullRequest($this);
                break;

            case 'rateLimit':
            case 'rate_limit':
                $api = new Api\RateLimit($this);
                break;

            case 'repo':
            case 'repos':
            case 'repository':
            case 'repositories':
                $api = new Api\Repo($this);
                break;

            case 'search':
                $api = new Api\Search($this);
                break;

            case 'team':
            case 'teams':
                $api = new Api\Organization\Teams($this);
                break;

            case 'member':
            case 'members':
                $api = new Api\Organization\Members($this);
                break;

            case 'user':
            case 'users':
                $api = new Api\User($this);
                break;

            case 'authorization':
            case 'authorizations':
                $api = new Api\Authorizations($this);
                break;

            case 'meta':
                $api = new Api\Meta($this);
                break;

            case 'graphql':
                $api = new Api\GraphQL($this);
                break;

            default:
                throw new InvalidArgumentException(sprintf('Undefined api instance called: "%s"', $name));
        }

        return $api;
    }
1088601
private function createCommandWithUri(
        Operation $operation,
        CommandInterface $command
    ) {
        // Get the path values and use the client config settings
        $variables = [];
        foreach ($operation->getParams() as $name => $arg) {
            /* @var Parameter $arg */
            if ($arg->getLocation() == 'uri') {
                if (isset($command[$name])) {
                    $variables[$name] = $arg->filter($command[$name]);
                    if (!is_array($variables[$name])) {
                        $variables[$name] = (string) $variables[$name];
                    }
                }
            }
        }

        // Expand the URI template.
        $uri = \GuzzleHttp\uri_template($operation->getUri(), $variables);

        return new Request(
            $operation->getHttpMethod(),
            Uri::resolve($this->description->getBaseUri(), $uri)
        );
    }
265384
public function getRequest($operationConfig, $operationMetadata, &$inputMap) {
        
        $action = $operationConfig->getAction();
        $resourcePath = $operationConfig->getResourcePath();
        $headerList = $operationConfig->getHeaderParams();
        $queryList = $operationConfig->getQueryParams();
        
        //arizzini: store seperately the header paramters
        $headerMap = Util::subMap($inputMap, $headerList);
        
        $url = $this->getUrl($operationConfig, $operationMetadata, $inputMap);
        
                
//        echo "-------------------------------------\n";
//        echo "-------------------------------------\n";
//        echo "url: $url \n";
//        echo "-------------------------------------\n";
//        echo "-------------------------------------\n";

        $contentType = "application/json; charset=utf-8";
        if (!empty($operationMetadata->getContentTypeOverride())) {
            $contentType = $operationMetadata->getContentTypeOverride()."; charset=utf-8";
        }
        
        
        $request = null;
        $requestBody = null;
        if (!empty($inputMap)) {
            $requestBody = json_encode($inputMap);
        } else {
            $requestBody = "{}";
        }

        switch ($action) {
            case "create":
                $request = new Request("POST", $url, [], $requestBody);
                $request = $request->withHeader("Content-Type", $contentType);
                break;
            case "delete":
                $request = new Request("DELETE", $url);
                break;
            case "update":
                $request = new Request("PUT", $url, [], $requestBody);
                $request = $request->withHeader("Content-Type", $contentType);
                break;
            case "read":
            case "list":
            case "query":
                $request = new Request("GET", $url);
                break;
        }
        
        $request = $request->withHeader("Accept", $contentType);
        $request = $request->withHeader("User-Agent", Constants::getCoreVersion() ."/". $operationMetadata->getApiVersion());
        foreach ($headerMap as $key => $value) {
            $request = $request->withHeader($key, $value);    
        }
        $request = ApiConfig::getAuthentication()->signRequest($url, $request);

        return $request;
    }
615554
protected function readOperationItem($params = []) {
        /** @var $api */
        extract($params);
        $request = $api['request'];
        $operation = $this->parseOperation($request, $params);
        $operation = $this->applyFilter('Operation', $operation, $params);
        return $operation;
    }
706430
function getOperationData($operation, $bindingType = 'soap')
    {
        if ($bindingType == 'soap') {
            $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
        } elseif ($bindingType == 'soap12') {
            $bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
        }
        // loop thru ports
        foreach ($this->ports as $port => $portData) {
            // binding type of port matches parameter
            if ($portData['bindingType'] == $bindingType) {
                // get binding
                //foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
                foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) {
                    // note that we could/should also check the namespace here
                    if ($operation == $bOperation) {
                        $opData = $this->bindings[$portData['binding']]['operations'][$operation];

                        return $opData;
                    }
                }
            }
        }
    }
363358
def call(self, operation, data):
        """"""
        print('API call [{0}:{1}], method - {2}, data - {3}'.format(
            self.host, self.api_key, operation, repr(data)))
129745
private function getOperationHandler(OperationInterface $operation)
    {
        foreach ($this->operationHandlers as $operationHandler) {
            if ($operationHandler->supports($operation)) {
                return $operationHandler;
            }
        }

        return null;
    }
942364
protected function setOperations(array $setOperations): string
	{
		if(empty($setOperations))
		{
			return '';
		}

		$sql = '';

		foreach($setOperations as $setOperation)
		{
			$sql .= $this->subquery($setOperation['query'], false) . ' ' . $setOperation['operation'] . ' ';
		}

		return $sql;
	}
924523
private function createOperationOutput(array &$output, OperationInterface $operation)
    {
        $operationHandler = $this->getOperationHandler($operation);

        if (!$operationHandler) {
            return;
        }

        $output[] = '';

        $urlGenerator = $this->getUrlGenerator(
            $operationHandler->extractSourceUrl($operation)
        );

        $output = array_merge(
            $output,
            $operationHandler->getOutput($operation, $urlGenerator)
        );
    }
975374
public static function api($serviceName = null)
    {
        $api = self::getContainer()->get('api');

        if ($serviceName !== null) {
            return $api->service($serviceName);
        }

        return $api;
    }
39779
protected function api($name)
    {
        switch ($name) {
            case 'benefit':
            case 'benefits':
                return new Api\Benefits($this);

            case 'company':
            return new Api\Company($this);

            case 'employee':
            case 'employees':
                return new Api\Employees($this);

            case 'image':
            case 'images':
            case 'photo':
            case 'photos':
                return new Api\Photos($this);

            case 'lastChanged':
            case 'lastChange':
            case 'changed':
            case 'changes':
                return new Api\LastChanged($this);

            case 'login':
            case 'auth':
                return new Api\Login($this);

            case 'meta':
            case 'metadata':
            case 'metaData':
                return new Api\Metadata($this);

            case 'payroll':
                return new Api\Payroll($this);

            case 'report':
            case 'reports':
                return new Api\Reports($this);

            case 'table':
            case 'tables':
                return new Api\Tables($this);

            case 'timeoff':
            case 'timeOff':
            case 'time_off':
            case 'pto':
                return new Api\TimeOff($this);

            case 'time':
            case 'timetracking':
            case 'time_tracking':
            case 'timeTracking':
                return new Api\TimeTracking($this);

            default:
                throw new \Exception("Invalid API ($name)");
        }
    }
461352
public static function fromUsername($username, ApiClient $apiClient = null)
    {
        if (is_null($apiClient)) {
            $apiClient = static::createApiClient();
        }

        $apiResult = $apiClient->uuidApi($username);

        $json = $apiResult;

        if (isset($json->error)) {
            throw new \RuntimeException('Mojang Error: '.$json->errorMessage);
        }

        if (empty($json) || !isset($json[0]->id)) {
            throw new \RuntimeException('Invalid Username ('.$username.')');
        }
        static::rateLimitBust();

        return static::fromUuid($json[0]->id);
    }
1172370
private static function getReport($apiAction)
    {
        if (strpos($apiAction, '.') === false) {
            return;
        }

        list($module, $action) = explode('.', $apiAction);
        $report = ReportsProvider::factory($module, $action);
        return $report;
    }
1187652
public function callHook(string $name, OperationInterface $operation)
    {
        if (!self::hasHook($name)) {
            return $operation;
        }

        $hook = $this->hooks[$name];

        return call_user_func($hook, $operation);
    }
981982
protected function _mapFnToApiMethod($function, &$apiparams)
  {
    // replace _ by /
    $method = $this->_mapFnInsertSlashes($function);

    // undo replacement for URL parameters
    $method = $this->_mapFnRestoreParamUnderscores($method);

    // replace AA by URL parameters
    list ($method, $method_template) = $this->_mapFnInlineParams($method, $apiparams);

    if (substr($method, 0, 4) !== 'ton/') {
      // replace A-Z by _a-z
      for ($i = 0; $i < 26; $i++) {
        $method  = str_replace(chr(65 + $i), '_' . chr(97 + $i), $method);
        $method_template = str_replace(chr(65 + $i), '_' . chr(97 + $i), $method_template);
      }
    }

    return [$method, $method_template];
  }