src/ArtaxServiceBuilder/APIGenerator.php
function addOperationGetter(
        $methodName,
        OperationDefinition $operation,
        OperationGenerator $operationGenerator
    ) {
        $operationName = $this->normalizeMethodName($methodName);
        $operationClassName = $this->normalizeClassName($methodName);
        $methodGenerator = new MethodGenerator($operationName);

        $apiParameters = $this->getAPIParameters();

        $body = '';

        //All required parameters must be passed in when the operation is created.
        $requiredParameters = $operation->getRequiredParams();
        
        $paramsStrings = [];
        $requiredParamsStringsWithDollar = [];
        $tags = [];

        $requiredParamsStringsWithDollar[] = '$this';
        
        foreach($requiredParameters as $requiredParam) {
            $translatedParam = ucfirst($this->translateParameter($requiredParam->getName()));
            $normalizedParamName = normalizeParamName($requiredParam->getName());
            
            
            if (array_key_exists($requiredParam->getName(), $apiParameters) == true) {
                $requiredParamsStringsWithDollar[] = sprintf(
                    '$this->get%s()',
                    $translatedParam
                );
            }
            else {
                $paramsStrings[] = $normalizedParamName;
                $tags[] = new GenericTag(
                    'param',
                    $requiredParam->getType().' $'.$requiredParam->getName().' '.$requiredParam->getDescription()
                );
                //TODO - replace with array_map on $paramsStrings
                $requiredParamsStringsWithDollar[] = '$'.$normalizedParamName;
            }
        }

        $paramString = implode(', ', $requiredParamsStringsWithDollar);
        $methodGenerator->setParameters($paramsStrings);
    
        $tags[] = new GenericTag(
            'return',
            '\\'.$operationGenerator->getFQCN().' The new operation '
        );

        $body .= "\$instance = new $operationClassName($paramString);".PHP_EOL;
        $body .= "return \$instance;".PHP_EOL;
    
        $docBlockGenerator = new DocBlockGenerator($methodName);
        $docBlockGenerator->setLongDescription($operation->getSummary());
        $docBlockGenerator->setTags($tags);

        $methodGenerator->setDocBlock($docBlockGenerator);
        $methodGenerator->setBody($body);
        $this->classGenerator->addMethodFromGenerator($methodGenerator);
        $this->interfaceGenerator->addMethodFromGenerator($methodGenerator);
    }
function addOperationGetter(
        $methodName,
        OperationDefinition $operation,
        OperationGenerator $operationGenerator
    ) {
        $operationName = $this->normalizeMethodName($methodName);
        $operationClassName = $this->normalizeClassName($methodName);
        $methodGenerator = new MethodGenerator($operationName);

        $apiParameters = $this->getAPIParameters();

        $body = '';

        //All required parameters must be passed in when the operation is created.
        $requiredParameters = $operation->getRequiredParams();
        
        $paramsStrings = [];
        $requiredParamsStringsWithDollar = [];
        $tags = [];

        $requiredParamsStringsWithDollar[] = '$this';
        
        foreach($requiredParameters as $requiredParam) {
            $translatedParam = ucfirst($this->translateParameter($requiredParam->getName()));
            $normalizedParamName = normalizeParamName($requiredParam->getName());
            
            
            if (array_key_exists($requiredParam->getName(), $apiParameters) == true) {
                $requiredParamsStringsWithDollar[] = sprintf(
                    '$this->get%s()',
                    $translatedParam
                );
            }
            else {
                $paramsStrings[] = $normalizedParamName;
                $tags[] = new GenericTag(
                    'param',
                    $requiredParam->getType().' $'.$requiredParam->getName().' '.$requiredParam->getDescription()
                );
                //TODO - replace with array_map on $paramsStrings
                $requiredParamsStringsWithDollar[] = '$'.$normalizedParamName;
            }
        }

        $paramString = implode(', ', $requiredParamsStringsWithDollar);
        $methodGenerator->setParameters($paramsStrings);
    
        $tags[] = new GenericTag(
            'return',
            '\\'.$operationGenerator->getFQCN().' The new operation '
        );

        $body .= "\$instance = new $operationClassName($paramString);".PHP_EOL;
        $body .= "return \$instance;".PHP_EOL;
    
        $docBlockGenerator = new DocBlockGenerator($methodName);
        $docBlockGenerator->setLongDescription($operation->getSummary());
        $docBlockGenerator->setTags($tags);

        $methodGenerator->setDocBlock($docBlockGenerator);
        $methodGenerator->setBody($body);
        $this->classGenerator->addMethodFromGenerator($methodGenerator);
        $this->interfaceGenerator->addMethodFromGenerator($methodGenerator);
    }
Add the methods that return the operations in the API.