public function build(
        $action,
        array $data,
        CliInput $input,
        Mapping $mapping
    )
    {
        $payloadMeta = $this->mapper->getPayloadMeta($data);
        if ($action === 'request') {
            return new RequestApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getServiceCall($data),
                $payloadMeta,
                $this->mapper->getRequestAttributes($data)
            );

        } elseif($action === 'response') {
            return new ResponseApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getHttpResponse($data),
                $this->mapper->getTransport($data),
                $this->mapper->getPayloadMeta($data),
                $this->mapper->getReturnValue($data)
            );
        }

    }