Factory method to fetch API objects.

@param string $name Name of the API object to retrieve

@return ApiConnector

@throws Exception\UnknownApiConnectorException
10704
public function get(string $name): ApiConnector
    {
        return $this->apiFactory->createApiConnector($name, $this->options);
    }
170600
public function create($name)
    {
        $config = $this->getConfiguration($name);

        if(null === $config) {
            throw new \RuntimeException(
                "Connection with name: $name not found."
            );
        }

        return new Client($config);
    }
1056325
public function api($name)
    {
        switch ($name) {
            case 'action':
            case 'actions':
                $api = new Api\Action($this);
                break;
            case 'board':
            case 'boards':
                $api = new Api\Board($this);
                break;
            case 'card':
            case 'cards':
                $api = new Api\Card($this);
                break;
            case 'checklist':
            case 'checklists':
                $api = new Api\Checklist($this);
                break;
            case 'list':
            case 'lists':
                $api = new Api\Cardlist($this);
                break;
            case 'member':
            case 'members':
                $api = new Api\Member($this);
                break;
            case 'notification':
            case 'notifications':
                $api = new Api\Notification($this);
                break;
            case 'organization':
            case 'organizations':
                $api = new Api\Organization($this);
                break;
            case 'token':
            case 'tokens':
                $api = new Api\Token($this);
                break;
            case 'webhook':
            case 'webhooks':
                $api = new Api\Webhook($this);
                break;
            default:
                throw new InvalidArgumentException(sprintf('Undefined api called: "%s"', $name));
        }

        return $api;
    }
1274845
protected function makeConnection($name)
    {
        $config = $this->getConnectionConfig($name);

        if (isset($this->extensions[$name])) {
            return call_user_func($this->extensions[$name], $config, $name);
        }

        if (!isset($config['driver'])) {
            throw new InvalidArgumentException(
                sprintf('The pub-sub connection [%s] is missing a "driver" config var.', $name)
            );
        }

        return $this->factory->make($config['driver'], array_except($config, ['driver']));
    }
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.'"');
        }
    }
292509
public function getByName($name) {
        try {
            $result = $this->soap()->getInfoByName([
                'auth'  => $this->config['auth'],
                'sname' => $name
            ]);
        } catch (SoapFault $e) {
            throw $e;
        }

        return $this->parseResult($result);
    }
852342
public static function get_connector($name = 'default')
    {
        $connection = self::get_conn($name);
        if ($connection) {
            return $connection->getConnector();
        }
        return null;
    }
520574
public function getService($name)
    {
        if (!$this->serviceManager) {
            throw new Exception\UndefinedReferenceException('Cannot get service without an service manager instance!');
        }

        return $this->serviceManager->get($name);
    }
477104
public function getAdapter(string $name): AdapterInterface
    {
        if (!$this->hasAdapter($name)) {
            throw new Exception\AdapterNotFound('auth adapter '.$name.' is not registered');
        }

        return $this->adapter[$name];
    }
1362780
public static function faucet(?string $name = null): Fetch
    {
        $name = $name ?? static::getDefaultSink();

        if (! \array_key_exists($name, static::$configs)) {
            throw new NonExistentClientException("[$name] has yet to be registered.");
        }

        return static::$faucets[$name] = static::resolve($name);
    }
259291
public function adapter(?string $name = null): AdapterInterface
	{
		$name = $name ?? $this->defaultAdapter;

		return $this->adapters[$name] ?? $this->adapterFactory($name);
	}
758168
public function get($name) {
        if (!isset($this->services[$name])) throw new ServiceNotFoundException('Service "'.$name.'" not found.');
        try {
            return $this->services[$name]->resolve($factory=false);
        }
        catch (\Exception $ex) {
            throw new ContainerException($ex->getMessage(), $ex->getCode(), $ex);
        }
    }
677806
public function getConnection($name)
	{
		if (array_key_exists($name, $this->_connections))
			return $this->_connections[$name];

		return null;
	}
1021228
public static function create($name)
    {
        $serializerClass = 'Dmishh\\SettingsBundle\\Serializer\\' . Container::camelize($name) . 'Serializer';

        if (class_exists($serializerClass)) {
            return new $serializerClass();
        } else {
            $serializerClass = $name;

            if (class_exists($serializerClass)) {
                $serializer = new $serializerClass();
                if ($serializer instanceof SerializerInterface) {
                    return $serializer;
                }
            }
        }

        throw new UnknownSerializerException($serializerClass);
    }
1203757
public function crawl($name = null, Api $api = null)
    {
        $api = new Crawl($name, $api);
        if (!$this->getHttpClient()) {
            $this->setHttpClient();
        }
        if (!$this->getEntityFactory()) {
            $this->setEntityFactory();
        }
        return $api->registerDiffbot($this);
    }
1238543
public static function create($name)
    {
        if (!isset(self::$adapters[$name])) {
            throw HttpAdapterException::httpAdapterDoesNotExist($name);
        }

        if (!self::capable($name)) {
            throw HttpAdapterException::httpAdapterIsNotUsable($name);
        }

        return new self::$adapters[$name]['adapter']();
    }
757075
public function getConnectionConfig(string $name = null)
    {
        $name = $name ?: $this->getDefaultConnection();

        $connections = $this->config->get($this->getConfigName().'.connections');

        if (!is_array($config = array_get($connections, $name)) && !$config) {
            throw new InvalidArgumentException("Adapter [$name] not configured.");
        }

        if (is_string($cache = array_get($config, 'cache'))) {
            $config['cache'] = $this->getCacheConfig($cache);
        }

        $config['name'] = $name;

        return $config;
    }