@param $apiName
@param $operation
@param $api
@param $method

@return array
164304
protected function getMDApiParams($apiName, $operation, $api, $method)
    {
        $params = array_keys($operation['parameters']);
        $params = $this->applyFilter('DocMDParams', $params, compact('operation', 'api', 'method'));
        return $params;
    }
1174676
protected function getMethodParameters($method, $docBlock = null): array
    {
        $result = [];

        /** @var \ReflectionParameter $param */
        foreach ($method->getParameters() as $param) {
            $parameter = new SmdParameter();
            $parameter->name = $param->getName();
            if (PHP_VERSION_ID > 70000) {
                $parameter->types = [(string)$param->getType()];
            }
            $parameter->optional = $param->isOptional();
            if ($parameter->optional) {
                $parameter->default = $param->getDefaultValue();
            }

            $result[$param->getName()] = $parameter;
        }

        if ($docBlock === null) {
            return array_values($result);
        }

        $params = $docBlock->getTagsByName(self::API_METHOD_DEFAULT_PARAMS);

        /** @var DocBlock\Tags\Param $param */
        foreach ($params as $param) {
            $name = (string)$param->getVariableName();

            $parameter = $result[$name] ?? new SmdParameter();
            $parameter->name = $name;

            if (!empty((string)$param->getDescription())) {
                $parameter->description = (string)$param->getDescription();
            }
            if (!empty((string)$param->getType())) {
                $parameter->types = explode('|', (string)$param->getType());
            }

            $result[$name] = $parameter;
        }

        /** @var ApiParam[] $params */
        $params = $docBlock->getTagsByName(self::API_METHOD_PARAMS);

        foreach ($params as $param) {
            $result = $this->getExtendedParameters($param, $result);
        }

        return array_values($result);
    }
258400
private function Flow_Aop_Proxy_getAdviceChains(string $methodName): array
    {
        if (isset($this->Flow_Aop_Proxy_groupedAdviceChains[$methodName])) {
            return $this->Flow_Aop_Proxy_groupedAdviceChains[$methodName];
        }

        $adviceChains = [];
        if (isset($this->Flow_Aop_Proxy_targetMethodsAndGroupedAdvices[$methodName])) {
            $groupedAdvices = $this->Flow_Aop_Proxy_targetMethodsAndGroupedAdvices[$methodName];
            if (isset($groupedAdvices[\Neos\Flow\Aop\Advice\AroundAdvice::class])) {
                $this->Flow_Aop_Proxy_groupedAdviceChains[$methodName][\Neos\Flow\Aop\Advice\AroundAdvice::class] = new \Neos\Flow\Aop\Advice\AdviceChain($groupedAdvices[\Neos\Flow\Aop\Advice\AroundAdvice::class]);
                $adviceChains = $this->Flow_Aop_Proxy_groupedAdviceChains[$methodName];
            }
        }

        return $adviceChains;
    }
1239523
public function callMethod (&$api, $module, $method, $args = array ())
	{
		
		// Set module class name
		
		$class		= $this->getModuleClass ($module);
		
		// Create module object
		
		$obj		= new $class;
		
		// Set the API reference
		
		$obj->api	= $api;
		
		// Call the method init function for any custom code before the action
		
		if ($obj->callInit ($this, $method, $args))
		{
			
			// Call module method and pass the arguments list as 
			
			$return	= call_user_func_array (array ($obj, $method), array ($args));
			
		}
		
		// Return result
		
		return $obj->getResult ();
		
	}
1361833
public function getFunctionariesFromRootAssociations($apiServiceFilterContext = null)
    {
        $result = [];

        foreach ($this->getRootAssociationIDs() as $key => $rootAssociationID) {
            try {
                $result[] = $this->getFunctionariesFromAssociation($rootAssociationID, $apiServiceFilterContext);
            } catch (ContextException $e) {
                if ($key === count($this->getRootAssociationIDs()) - 1) {
                    throw $e;
                }
            }
        }

        return $result;
    }
274535
function (operation, parameter) {
  // TODO the reference to operation.api is not available
  if (operation.api && operation.api.parameterMacro) {
    return operation.api.parameterMacro(operation, parameter);
  } else {
    return parameter.defaultValue;
  }
}
173256
public function fetchAll(ApiInterface $api, $method, array $parameters = [])
    {
        // get the perPage from the api
        $perPage = $api->getPerPage();

        // set parameters per_page to max to minimize number of requests
        $api->setPerPage(100);

        try {
            $result = $this->fetch($api, $method, $parameters)['values'];

            while ($this->hasNext()) {
                $next = $this->fetchNext();
                $result = array_merge($result, $next['values']);
            }
        } finally {
            // restore the perPage
            $api->setPerPage($perPage);
        }

        return $result;
    }
1148612
public function getTransactionsByOutputAddress(string $address, string $apiKey): array
    {
        return $this->get(
            sprintf('%s/%s/%s', Resources::LIST_OF_TRANSACTIONS_WITH_API_KEY_BY_ADDRESS, $address, $apiKey)
        );
    }
916746
protected function getMDApiEndpoint($apiName, $operation, $api, $method)
    {
        $anchor = $this->applyFilter('DocMDApiExternalLink', 'API DOC');
        $description = $api['request']['description'];
        $matched = preg_match('/\[' . $anchor . '\]\([^)]+\)/', $description, $apiDocUrl);
        $docApiEndpoint = " \[{$operation['httpMethod']}\] /{$operation['uri']} ";
        if (!empty($matched) && isset($apiDocUrl[0])) {
            $docApiEndpoint = str_replace($anchor, $docApiEndpoint, $apiDocUrl[0]);
        }
        $docApiEndpoint = $this->applyFilter('DocMDEndpoint', $docApiEndpoint, compact('operation', 'api', 'method'));
        return $docApiEndpoint;
    }
192691
protected function getOperationAsArray(FetcherOperation $operation)
    {
        $filters = array();

        if ($operation instanceof SimpleOperation) {
            $filters = $this->addSimpleOperation($operation);
        } else if ($operation instanceof ListOperation) {
            $operations = $operation->getOperations();

            if ($operation->getOperator() === Fetcher::OPERATOR_OR) {
                $filters['$or'] = array_map(
                    function (FetcherOperation $operation) {
                        return $this->getOperationAsArray($operation);
                    },
                    $operations
                );
            } else {
                foreach ($operations as $currentOperation) {
                    $currentFilters = $this->getOperationAsArray($currentOperation);
                    $filters = array_merge_recursive($filters, $currentFilters);
                }
            }
        } else {
            throw new \InvalidArgumentException('Given operation is not supported');
        }

        return $filters;
    }
88473
function (methodName) {
            var parameters = this.smd.parameters || [];

            parameters = parameters.concat(this.smd.services[methodName].parameters || []);

            return parameters;
        }
1211828
def operation(self, name):
        
        try:
            return self.operations[name]
        except Exception, e:
            raise MethodNotFound(name)
1207309
private function getApiDoc(bool $collection, string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $resourceHydraDoc, array $entrypointHydraDoc = []): ApiDoc
    {
        if ($collection) {
            $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);
            $route = $this->operationMethodResolver->getCollectionOperationRoute($resourceClass, $operationName);
            $operationHydraDoc = $this->getCollectionOperationHydraDoc($resourceMetadata->getShortName(), $method, $entrypointHydraDoc);
        } else {
            $method = $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
            $route = $this->operationMethodResolver->getItemOperationRoute($resourceClass, $operationName);
            $operationHydraDoc = $this->getOperationHydraDoc($method, $resourceHydraDoc);
        }

        $data = [
            'resource' => $route->getPath(),
            'description' => $operationHydraDoc['hydra:title'] ?? '',
            'resourceDescription' => $resourceHydraDoc['hydra:title'] ?? '',
            'section' => $resourceHydraDoc['hydra:title'] ?? '',
        ];

        if (isset($operationHydraDoc['expects']) && 'owl:Nothing' !== $operationHydraDoc['expects']) {
            $data['input'] = sprintf('%s:%s:%s', ApiPlatformParser::IN_PREFIX, $resourceClass, $operationName);
        }

        if (isset($operationHydraDoc['returns']) && 'owl:Nothing' !== $operationHydraDoc['returns']) {
            $data['output'] = sprintf('%s:%s:%s', ApiPlatformParser::OUT_PREFIX, $resourceClass, $operationName);
        }

        if ($collection && 'GET' === $method) {
            $resourceFilters = $resourceMetadata->getCollectionOperationAttribute($operationName, 'filters', [], true);

            $data['filters'] = [];
            foreach ($resourceFilters as $filterId) {
                if ($filter = $this->getFilter($filterId)) {
                    foreach ($filter->getDescription($resourceClass) as $name => $definition) {
                        $data['filters'][] = ['name' => $name] + $definition;
                    }
                }
            }
        }

        $apiDoc = new ApiDoc($data);
        $apiDoc->setRoute($route);

        return $apiDoc;
    }
1187652
public function callHook(string $name, OperationInterface $operation)
    {
        if (!self::hasHook($name)) {
            return $operation;
        }

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

        return call_user_func($hook, $operation);
    }
546776
private ApiDoc getApiDoc(Class<?> controller, MethodDisplay displayMethodAs) {
		log.debug("Getting JSONDoc for class: " + controller.getName());
		ApiDoc apiDoc = initApiDoc(controller);

		apiDoc.setSupportedversions(JSONDocApiVersionDocBuilder.build(controller));
		apiDoc.setAuth(JSONDocApiAuthDocBuilder.getApiAuthDocForController(controller));
		apiDoc.setMethods(getApiMethodDocs(controller, displayMethodAs));
		
		if(controller.isAnnotationPresent(Api.class)) {
			apiDoc = mergeApiDoc(controller, apiDoc);
		}
		
		return apiDoc;
	}
1163437
def _create_api_method(cls, name, api_method):
    
    def _api_method(self, **kwargs):
        # lookup the command
        command = api_method['name']
        if kwargs:
            return self._make_request(command, kwargs)
        else:
            kwargs = {}
            return self._make_request(command, kwargs)
    _api_method.__doc__ = api_method['description']
    _api_method.__doc__ += _add_params_docstring(api_method['params'])
    _api_method.__name__ = str(name)
    setattr(cls, _api_method.__name__, _api_method)
133117
public function getPayload($module, $methodName)
    {
        $payloads = array();

        $config = $this->getServiceLocator()->get('MelisCoreConfig');
        $payloads = $config->getItem('diagnostic/'.$module.'/methods/'. $this->getMethodName($methodName) .'/payloads');

        return $payloads;

    }