@param string $name

@return AbstractApi|mixed
@throws InvalidArgumentException
550800
public function api($name)
    {
        switch ($name) {

            case 'deploy_keys':
                return $this->deployKeys();

            case 'groups':
                return $this->groups();
                
            case 'groupsMilestones':
                return $this->groupsMilestones();

            case 'issues':
                return $this->issues();

            case 'board':
            case 'issue_boards':
                return $this->issueBoards();

            case 'group_boards':
                return $this->groupsBoards();

            case 'issue_links':
                return $this->issueLinks();

            case 'jobs':
                return $this->jobs();

            case 'mr':
            case 'merge_requests':
                return $this->mergeRequests();

            case 'milestones':
            case 'ms':
                return $this->milestones();

            case 'namespaces':
            case 'ns':
                return $this->namespaces();

            case 'projects':
                return $this->projects();

            case 'repo':
            case 'repositories':
                return $this->repositories();

            case 'repositoryFiles':
                return $this->repositoryFiles();
                
            case 'snippets':
                return $this->snippets();

            case 'hooks':
            case 'system_hooks':
                return $this->systemHooks();

            case 'users':
                return $this->users();

            case 'keys':
                return $this->keys();

            case 'tags':
                return $this->tags();

            case 'version':
                return $this->version();

            case 'environments':
                return $this->environments();

            case 'deployments':
                return $this->deployments();

            case 'schedules':
                return $this->schedules();

            default:
                throw new InvalidArgumentException('Invalid endpoint: "'.$name.'"');
        }
    }
934309
public static function get($name)
    {
        if (!isset(static::$types[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
            }

            static::$types[$name] = new static::$map[$name];
        }

        return static::$types[$name];
    }
280919
protected function load($name)
    {
        if ($name instanceof \Twig_Template) {
            return $name;
        }

        try {
            return $this->environment->loadTemplate($name);
        } catch (\Twig_Error_Loader $e) {
            throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
        }
    }
524488
public function getFileParameter($name)
    {
        if (!$this->hasFileParameter($name)) {
            throw new \InvalidArgumentException(sprintf('The file request parameter "%s" does not exist.', $name));
        }

        return $this->fileParameters[$name];
    }
273839
public function find($name)
    {
        if ($this->is_registered($name)) {
            return $this->items[$name];
        }
        $model = $this->adaptor->getModel($name);
        if ($model) {
            return $model;
        }
        throw new \InvalidArgumentException("{$name} not registered");
    }
1082411
public function getPlugin($name)
    {
        if (!isset($this->plugins[$name])) {
            throw new \InvalidArgumentException(sprintf('Plugin %s is not registered'));
        }

        return $this->plugins[$name];
    }
241466
protected function load($name)
    {
        if ($name instanceof Template) {
            return $name;
        }

        try {
            return $this->environment->loadTemplate((string) $name);
        } catch (LoaderError $e) {
            throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
        }
    }
525522
public function getParameter($name)
    {
        if (!array_key_exists($name, $this->config)) {
            throw new \InvalidArgumentException(sprintf(
                'Parameter "%s" has not been registered',
                $name
            ));
        }

        return $this->config[$name];
    }
586213
public function getParameter($name)
    {
        if (!array_key_exists($name, $this->parameters)) {
            throw new InvalidArgumentException(sprintf('Parameter: "%s" does not exist', $name));
        }

        return $this->parameters[$name];
    }
112590
public function getOption($name) {
        if (!$this->definition->hasOption($name)) {
            throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
        }

        return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
    }
1123632
private function service($name)
    {
        if (!isset($this->registry[$name])) {
            if (isset(self::$services[$name])) {
                $this->registry[$name] = new self::$services[$name]($this);
            } else {
                throw new InvalidArgumentException(sprintf('Service %s does not implement', $name));
            }
        }

        return $this->registry[$name];
    }
200256
public function getPathParameter($name)
    {
        if (!$this->hasPathParameter($name)) {
            throw new \InvalidArgumentException(sprintf('The path request parameter "%s" does not exist.', $name));
        }

        return $this->pathParameters[$name];
    }
379957
public function option(string $name)
    {
        if (!array_key_exists($name, $this->options))
            throw new \InvalidArgumentException("Unknown option '{$name}'");
        return $this->options[$name];
    }
468404
public function getPostParameter($name)
    {
        if (!$this->hasPostParameter($name)) {
            throw new \InvalidArgumentException(sprintf('The POST request parameter "%s" does not exist.', $name));
        }

        return $this->postParameters[rawurlencode($name)];
    }
590556
final public function getParameter(string $name)
    {
        if (! array_key_exists($name, $this->parameters)) {
            throw new InvalidArgumentException("Filter parameter '" . $name . "' is not set.");
        }
        return $this->parameters[$name];
    }
554822
protected function createGateway($name)
    {
        if (isset($this->customCreators[$name])) {
            $gateway = $this->callCustomCreator($name);
        } else {
            $className = $this->formatGatewayClassName($name);
            $gateway = $this->makeGateway($className);
        }

        if (!($gateway instanceof GatewayInterface)) {
            throw new InvalidArgumentException(sprintf('Gateway "%s" not inherited from %s.', $name, GatewayInterface::class));
        }

        return $gateway;
    }
453494
public function getBehavior($name)
    {
        /** @var \Cake\ORM\Behavior $behavior */
        $behavior = $this->_behaviors->get($name);
        if ($behavior === null) {
            throw new InvalidArgumentException(sprintf(
                'The %s behavior is not defined on %s.',
                $name,
                get_class($this)
            ));
        }

        return $behavior;
    }